?
Solved

connect

Posted on 1999-06-28
4
Medium Priority
?
170 Views
Last Modified: 2011-04-14
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
0
Comment
Question by:abidr
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
himachal earned 240 total points
ID: 1520319
Hi,
You need to have the ODBC driver for Sybase to do that.You van download it from the Sybase website.You have to run the catalog.sql script to update some system table & driver information.You can also get ODBC driver for sybase from "Intersolve".
Himachal
0
 

Author Comment

by:abidr
ID: 1520320
thanks,

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
0
 
LVL 1

Expert Comment

by:himachal
ID: 1520321
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
0
 

Expert Comment

by:robhammond
ID: 2800451
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;database=YourDB; dsn=YourDNS(Not always required)"
    With cn
        .ConnectionString = Cnct
        .ConnectionTimeout = 10
        .CursorLocation = adUseServer
        .Open
    End With
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question