Run-time error 80040e05

By k.adityakiran ·

Can any one tell me what is wrong with the following code snippet:

I am getting the Run-time error '-2147217**5 (80040e05'; Object Was Open when I run the VB script containing this code. This is the part of the code which throws error, because I have a statement to write to log file before this and the code works fine till there:

oradb = New ADODB.Connection
oradb.CursorLocation = ADODB.CursorLocationEnum.adUseClient
oradb.Open("Provider=MSDASQL;DSN=" & sDSN & ";UID=" & sOraUserId & ";PWD=" & sOraPwd)
sqlstring = "select * from siebel.EIM_ACCOUNT where IF_ROW_BATCH_NUM = '" & sBatchNumber & "'"
rsEIM = New ADODB.Recordset
rsEIM.Open(sqlstring, oradb, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockOptimistic)

Please help.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

This code makes no sense

by Slayer_ In reply to Run-time error 80040e05

I can't tell what language your using, cant be VB6 or VBScript as its missing parts required for both languages.

And most of it doesn't make sense, example.

oradb = New ADODB.Connection

Would never work, missing keyword "set" for VB6 or VBScript.

you are also using a variable you did not declare, "option explicit" should be specified to prevent this issue.

Collapse -


by k.adityakiran In reply to This code makes no sense
Collapse -

Here are some error codes for you to look at......

by Peconet Tietokoneet In reply to Run-time error 80040e05

Related Discussions

Related Forums