Click to See Complete Forum and Search --> : Access a Microsoft Access database


Mikael Bengtsson
July 31st, 2001, 09:39 AM
Hi,
I am trying to connect to an Access database using ADO in visual basic. Can anyone help me with this. I don't know how to compose the connection string.

Cimperiali
July 31st, 2001, 10:22 AM
'add and Ado control to your form,
'right click on it, select properties, and
'let it help you in building the connection
'string. then remove it from your
'form and from loaded components if
'you do noyt want to use.
Dim strConnect as string
Dim strconnectPwd as string
'without password
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Programmi\Microsoft Visual Studio\VB98\Biblio.mdb;Persist Security Info=false"
'with password remembered
strconnectPwd = "Provider=Microsoft.Jet.OLEDB.4.0;Password=donald;Data Source=C:\Programmi\Microsoft Visual Studio\VB98\Biblio.mdb;Persist Security Info=true"




Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood,
Bruno Paris and all the other wonderful people who made and make Codeguru
a great place.
Come back soon, you Gurus.

The Rater