Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't connect to Oracle using Win32::ODBC

Status
Not open for further replies.

flowcontrol

Programmer
Oct 16, 2002
86
US
I am having trouble connecting to an Oracle 10g Release 2 database using Win32::ODBC. I receive the following error message:

'The instruction at "0x7c911e58" referenced memory at "0xffffffff". The memory could not be "read"'.

My code:

use Win32::ODBC;
$connectionString = 'BATHY';
$db = Win32::ODBC->new($connectionString);

"BATHY" is the system DSN on my machine, which I tested using the "Test Connection" button in the ODBC Datasource Administrator. The code above works perfectly when I connect to a SQL Server database using a full DSN connection string of "DSN=FLRC-DEV;UID=flrcuser;PWD=mypassword", so I tried the following connection string:

"DSN=BATHY;UID=bathyuser@GKBEB;PWD=mypassword"

I get the same error. ("GKBEB" is the TNS service name.) I suspect that my connection string is incorrect, but I'm new to Oracle and I'm at a loss.

Does anyone have any ideas as to what is wrong?
 
You might get a quicker response on the Oracle forum. In the meantime, this is a useful web site

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Probably a side-note: but you don't want the @ symbol in a double-quoted string unless you want perl to (try to) expand into a string from an array:

"DSN=BATHY;UID=bathyuser[red]@[/red]GKBEB;PWD=mypassword"

should be:

"DSN=BATHY;UID=bathyuser[red]\@[/red]GKBEB;PWD=mypassword"

or:

[red]'[/red]DSN=BATHY;UID=bathyuser@GKBEB;PWD=mypassword[red]'[/red]





------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top