Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

connect

Posted on 1999-06-28
4
Medium Priority
?
166 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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

722 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