Author |
Topic  |
|
peter.cook
UK
356 Posts |
Posted - 01/11/2006 : 2:16:44 PM
|
Origin Version (Select Help-->About Origin): 7.5 SR7 Operating System: Win2000
Hi,
I have the same code for 2 opj files that connects to a database and pastes the data into a worksheet. ie the code and sql statement are correct. For 1 oj it works fine but for the other I get 'Error : 284'
Any help /suggestions would be appreciated!
Cheers,
Pete
|
|
ML
USA
63 Posts |
Posted - 01/11/2006 : 3:18:24 PM
|
Hi Peter,
Where do you see the error 'Error : 284'? Message box or Script Window? Also, are you running OC code when the error appears, and, if so, at which line of OC code (you can debug line-by-line to find that out) do you see the error (perhaps you could paste the OC code, or part thereof, which you use for accessing db and putting values into worksheets)?
Thanks.
ML
Edited by - ML on 01/11/2006 3:19:53 PM |
 |
|
peter.cook
UK
356 Posts |
Posted - 01/12/2006 : 09:16:27 AM
|
Hi Marko,
The offending code was :
void OCQuery_ATP_levels() { Object ocrs; string SQLString; SQLString = "select d1.ID, d1.KINASE_SYMBOL, d1.KINASE_NAME, d1.ATP_LEVEL from pete_assays d1, pete_assay_panel d2 where d1.ID = d2.ASSAY_ID and d2.current_process_quarter_panel = 'Y' ORDER BY d1.ID"; ocrs = CreateObject("ADODB.Recordset"); try { ocrs.open(SQLString, "Provider=msdaora; Data Source=RES1; User ID=UserID; Password=Password;"); }; catch (int ErrorCode) { MessageBox(GetWindow(),"Could not connect to database"); return; }; Worksheet wks("ATPlevels"); // Put the recordset into worksheet: BOOL bRet = wks.PutRecordset(ocrs, 0, -1, 0, LAYWKGETRECORDSET_BY_COLUMN_INDEX); //out_int("bRet = ", bRet); }
However, both apps were working today! It is possible that I have lost track of which was the correct app version but in the event that this occurs again any info re error code or other insight would be useful. Thanks,
Update : Happened again but not on another PC ..
Cheers,
Pete
Edited by - peter.cook on 01/12/2006 10:33:43 AM |
 |
|
ML
USA
63 Posts |
Posted - 01/12/2006 : 12:28:38 PM
|
When the error occurs (either a message box or in Script window), can you, please, make a screen grab of that portion of the screen where you see the error displayed, and post it here?
Thanks.
ML
|
 |
|
peter.cook
UK
356 Posts |
Posted - 01/12/2006 : 12:46:01 PM
|
Hi again,
The message box in the catch script outputs 'Could not connect to database' and the code falls down at the 'ocrs.open(SQLString...' line as per the try statement.
The error code or value of ErrorCode is 284.
Cheers,
Pete
|
 |
|
ML
USA
63 Posts |
Posted - 01/12/2006 : 7:17:16 PM
|
Hi Peter,
It appears that the error is coming from a failed automation call to the Recordset object. The object (i.e. the server) may provide a more detailed textual information about the failure. But since the call is inside a try-catch block, there is no run-time error, and, thus, no (possible) additional textual information is displayed.
Can you, therefore, remove the try-catch. In this case when the failure occurs, Origin C execution will stop, and you may see more text dumped to the output (Script Window or elsewhere). If so, please, post the text here.
Thanks.
ML
|
 |
|
|
Topic  |
|
|
|