Get Jet Connection String
Posted by: fredometro on
Jun 5th, 2007 |
Filed under: MS-Access
Need to connect to an Access database with ADO? Using workgroup security? Here is a function which will return an opened connection to the jet database:
Public Function GetJetConnection(strPath As String, _
Optional strDBPwd As String, _
Optional strSysDBPath As String, _
Optional strUserID As String, _
Optional strUserPwd As String) _
As ADODB.Connection
Dim cnnDB As ADODB.Connection
Set cnnDB = New ADODB.Connection
With cnnDB
.Provider = “Microsoft.Jet.OLEDB.4.0″
‘.Mode = lngMode
.Properties(”Jet OLEDB:Database Password”) = strDBPwd
.Properties(”Jet OLEDB:System Database”) = strSysDBPath
‘.Properties(”Jet OLEDB:Engine Type”) = lngEngineType
.Open ConnectionString:=strPath, _
UserID:=strUserID, _
Password:=strUserPwd
End With
Set GetJetConnection = cnnDB
End Function
Need an example? Here it is, connecting to the current database:
Set rs = New ADODB.Recordset
rs.Open “Select * from <TableName>”, _
GetJetConnection(CurrentDb.Name, , <system DB path>, <user>, <password>), _
adOpenKeyset, adLockOptimistic


December 12th, 2009 at 10:08 am
XXX Panty Sniff
December 12th, 2009 at 10:09 am
Karen Palms
December 12th, 2009 at 10:10 am
Throat Gaggers
December 12th, 2009 at 10:11 am
Teen Models
December 12th, 2009 at 10:12 am
Fantasy Girl Carmella
December 12th, 2009 at 10:13 am
Bella XoXo
December 12th, 2009 at 10:14 am
Outdoor XXX Games
December 12th, 2009 at 10:15 am
Gay Anal Vids
December 12th, 2009 at 10:16 am
Huge Rubber Dicks
December 12th, 2009 at 10:17 am
Naughty Book Worms
December 12th, 2009 at 10:18 am
Sweet Zuzanna
December 12th, 2009 at 10:19 am
See Her Squirt
December 12th, 2009 at 10:20 am
Reality Filth
December 12th, 2009 at 10:21 am
StrapOn Jane
December 12th, 2009 at 10:23 am
Housewife 1on1
December 12th, 2009 at 10:24 am
Teen Kim
Add A Comment
You must be logged in to post a comment.