|
-
Nov 22nd, 2000, 10:41 AM
#1
Thread Starter
Addicted Member
I have an Access database name called hello.mdb stored in C:\Databases. Can someone please show me how to connect to this database using ADO.
Thanks in advance
JK
-
Nov 22nd, 2000, 10:48 AM
#2
New Member
Opening Access Database Using ADO
Dim DSN As New ADODB.Connection
Dim Rs As New ADODB.Recordset
Dim strPath$
'Access Version
strPath = "d:\temp\test.mdb"
With DSN
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Open strPath, Uid, PW
End With
SQL = "Select * From Table_Name"
Rs.Open SQL, DSN, adOpenDynamic, adLockOptimistic
You can do anything you want with this. I usually
make DSN Global to the whole project, you can then
use it anywhere.
-
Nov 22nd, 2000, 10:49 AM
#3
New Member
Opening Access Database Using ADO
Dim DSN As New ADODB.Connection
Dim Rs As New ADODB.Recordset
Dim strPath$
'Access Version
strPath = "d:\temp\test.mdb"
With DSN
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Open strPath, Uid, PW
End With
SQL = "Select * From Table_Name"
Rs.Open SQL, DSN, adOpenDynamic, adLockOptimistic
You can do anything you want with this. I usually
make DSN Global to the whole project, you can then
use it anywhere.
Corby Nichols
-
Nov 22nd, 2000, 11:20 AM
#4
Thread Starter
Addicted Member
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
|