how do i connect to a password protected database through VB.......

Hi,

If using DAO :
Dim DB As DataBase
Set DB = DBEngine.OpenDatabase("C:\DB1.mdb", False, False, ";PWD=MyPWD")

If using ADO:
Set conn = New ADODB.Connection
conn.ConnectionString = _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\DB1.mdb;" & _
"Jet OLEDB:Database " & _ "Password=MyPWD"
conn.Open

Regards
Veena

Hi,

That is:
Set conn = New ADODB.Connection
conn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\DB1.mdb;" & _
"Jet OLEDB:Database Password=MyPwd"
conn.Open

Hi,

I dont know why Icon is being printed.

Jet OLEDB:Database Password

Regards
Veena

Hi,

Replace Icon by ":" (Colon)

thanx a ton veena......m vry grateful 2 u

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.