Access Database & password

sevil
04-19-2004, 01:18 PM
Hello,
I m using Access2000 as backend and i hv set password on the database. Now how to include this thing in my connection commands, i mean how to pass this password from VB through commands. My connection commands r given bellow.

Dim con As New ADODB.Connection
Dim mrec As New ADODB.Recordset

With con
.Provider = "Microsoft.jet.OLEDB.4.0"
.ConnectionString = "d:\sevill\sunbird\sunbird.mdb"
.Open
End With

'i use follwoing pattern to retrive data
mrec.Open "select count(*) from grnMaster", con, adOpenKeyset, adLockBatchOptimistic

Thanks,
Sevil

HardCode
04-19-2004, 01:31 PM
http://www.able-consulting.com/ADO_Conn.htm has all of the connection string examples for Access. Check it out. Look for the one with the password in the connection string.

sevil
04-19-2004, 01:45 PM
Thanks.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum