Link to home
Start Free TrialLog in
Avatar of BooH
BooH

asked on

SQL 6.5 & VB - No ODBC - How to set database?

I'm creating a VB 4.0 application to access data on an SQL server 6.5 database.  I'm not using ODBC, but an .ini file instead.  My last stumbling block (I hope!) is how to set the database parameter so that I can create a recordset with the results of my query.

Below is what PREVIOUSLY set the database for me (when the data was on Sybase, and we used ODBC):
    connect_string = "ODBC;DSN=APPLE;DATABASE=SEED1;"
    Set db = OpenDatabase("APPLE", False, False, connect_string)

The following code is what NOW sets the connection to the database, but it doesn't set the actual database object:
    SqlConn& = SqlOpenConnection(ServerName$, User$, Pwd$, "", "")


I know I'm connecting to the server and database successfully, but just can't seem to set the database parameter.  This is killing me because when I go to run the query against the database, I can't create the recordset without the database object as a reference (see below):
     Set gSrchSet = db.OpenRecordset(gSrchStr, dbReadOnly)

It doesn't know what 'db' is.  

Please help me!  I've been going crazy on this for weeks!  Huge appreciation to anyone who can help!  Thanks so much!
ASKER CERTIFIED SOLUTION
Avatar of wizard2072098
wizard2072098

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of telebasics
telebasics

Where the *&^ do those commands come from? my VB doesn;t know them and i can't find a control that does. Please tell me