|
-
September 10th, 2001, 10:40 AM
#2
Re: Access 2000 ODBC Connection
I will assume that you have a data source set up to access the database (no pun intended), so try something
like this:
option Explicit
Dim oConn as new ADODB.Connection
private Sub Form_Load()
oConn.ConnectionString = "dsn=?" ' The ? would be your dsn name
oConn.Open
End Sub
This is the easiest way I have seen for opening a connection to ANY database. If you don't have the dsn set up,
go into your control panel, and under ODBC data sources set up the data source. You will have to specify
the type of database and the location of said database. That way, when you use the ConnectionString statement
above, you have already defined the provider, etc., and the Open statement will open that data source. Does
this make sense?
Spectre5000
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|