Question Locked

Run-time error 80040e05

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

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

I am getting the Run-time error '-2147217915 (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.

Regards,
Aditya

4 replies

by slayer_

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.

This discussion is closed to new replies.