Pergunta

I'm having problems trying to connect in my oracle database using an ADODB object in VBScript, the code is working on a Win7 machine but not on WinXP, I tried to search for the error code, downloaded the sdk with the help file to look for something but I didn't found nothing useful.

Here is the code sample:

ConnectionString = "DSN=(Oracle in OraClient11g_home1);UID=username ;PWD=password ;DBQ=myDatabase"
Set objCon = CreateObject("ADODB.Connection")
objCon.Open ConnectionString 'the error occurs in this line

I don't know if the connection string must be different for winXP machines... I really don't know how to solve this, can someone help me?

The error trace information:

"Error #-2147024770: 
Error reported by: ADODB.Connection
Help File: 
Topic ID: 1240640"
Foi útil?

Solução

-2147024770 = FFFFFFFF8007007E

To Decode 0x8007nnnn Errors

HResults with facility code 7 means the HResult contains a Windows' error code. You have to look up the Windows' error code not the HResult.

To decode 0x8007007e. The 0x means it's a hexadecimal number, the 8 means error, the first 7 means it a windows error, and the rest of the number, 7e, is the actual Windows error.

To look up the error we need it in decimal format. Start Calculator (Start - All Programs - Accessories - Calculator) and choose View menu - Scientific, then View menu - Hex. Enter 7e. Then View menu - Decimal. It will say 126.

Start a Command Prompt (Start - All Programs - Accessories - Command Prompt) and type

net helpmsg 126

and it will say

The specified module could not be found.

or look it up in winerror.h

//
// MessageId: ERROR_MOD_NOT_FOUND
//
// MessageText:
//
// The specified module could not be found.
//
#define ERROR_MOD_NOT_FOUND              126L

To see what is happening start your program in ntsd.

Start a command prompt.

Type

md c:\symbols
set _NT_SYMBOL_PATH=srv*C:\tmp*http://msdl.microsoft.com/download/symbols;c:\symbols

then (changing it to your program from notepad)

ntsd -g -o c:\windows\notepad.exe

so something

ntsd -g -o wscript "c:\folder\script.vbs"

and wait for the error.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top