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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to a Sybase 12.5 DB

Status
Not open for further replies.

robz2009

Programmer
Apr 20, 2009
41
GB
I am having problems connecting my Visual Basic 6 project to a Sybase 12.5 database, I want to code it so that a DSN is not needed.

When using this code,

conn.Open "Driver={SYBASE SYSTEM 11};" & _
"Srvr=wwhbsdb1,5555;" & _
"DB=AML;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"

I get the error,

-2147467259 - [INTERSOLV][ODBC SQL Server driver][SQL Server]ct_connect(): directory service layer: internal directory control layer error: Requested server name not found.

And when attempting to use a different driver with this code,

conn.Open "Driver={SYBASE ASE ODBC Driver};" & _
"Srvr=wwhbsdb1,5555;" & _
"DB=AML;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"

I get the error,

-2147467259 - [MERANT][ODBC Sybase ASE driver]Insufficient information to connect to the data source.

I am getting really stuck with this? I have re-installed Sybase 12.5 because I thought I had the wrong drivers, is there an issue here? What driver should I have displayed and also reference in ODBC Administrator > Drivers?

N.B. The full Sybase DB version is Adaptive Server Enterprise/12.5.3/EBF 13327 ESD#7/P/RS6000/AIX 5.1/ase1253/1951/64-bit/FBO/Fri Mar 24 04:52:26 2006
 
try this:

instead of using the computer name (for the srvr part), try using the IP Address for the database server instead.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
It was initially IP address and port in the format of

*0.*34.*2.*1,5555;

I thought this was causing problems hence using the server name. For purpose I have just tried it with IP address and I get exactly the same errors :(

P.S. Reading various resources online it states that "{SYBASE ASE ODBC Driver}" is the driver shipped with 12.5 so I don't think that's a problem.
 
I have now managed to fix this. The fix is to replace the Srvr parameter with NetworkAddress. The working connection string is,

conn.Open "Driver={SYBASE ASE ODBC Driver};" & _
"NetworkAddress=wwhbsdb1,5555;" & _
"DB=AML;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"

I managed to find this after extensive searching online. Additional info posted was that "This was a major change in the ODBC driver. It does not require Open Client
to access the ASE."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top