abidr
asked on
connect
how can I connect to a sybase database file from my VB6 project. I looked in the types of databased i can connect to, this was not listed. it has an extension of .DB. I need to generate reports from that file.
thanks
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
If you have downloaded the driver and run the setup then in Control Panel's ODBC must show this driver.You have to make a dsn by giving appropiate information and then using this DSN you can connect to the sybase databse.
Himachal
If you have downloaded the driver and run the setup then in Control Panel's ODBC must show this driver.You have to make a dsn by giving appropiate information and then using this DSN you can connect to the sybase databse.
Himachal
The driver should be supplied with sybase package and should show up on the Drivers tab of the ODBC32 utility in the Windows control panel. The code should look something like this:
Dim cn As New adodb.Connection
Cnct = "uid=" & userID & ";pwd=" & Password & ";driver={Adaptive Server Anywhere 7.0};server=YourServer;dat abase=Your DB; dsn=YourDNS(Not always required)"
With cn
.ConnectionString = Cnct
.ConnectionTimeout = 10
.CursorLocation = adUseServer
.Open
End With
Dim cn As New adodb.Connection
Cnct = "uid=" & userID & ";pwd=" & Password & ";driver={Adaptive Server Anywhere 7.0};server=YourServer;dat
With cn
.ConnectionString = Cnct
.ConnectionTimeout = 10
.CursorLocation = adUseServer
.Open
End With
ASKER
I have the drivers with the application but how can I make VB6 recognise it. Is there a way to register it or add it to any sys file... I have not done this before so if u can advise please.
ab