Click to See Complete Forum and Search --> : ADODB.Connection


July 26th, 2000, 11:11 AM
Dear ladies and gentlemen,

I am trying to use ADODB.Connection
My code is working fine without the password but if I try to create database password I got the following error:

Run time error ‘-2147467259(80004005):
Could not find installable ISAM.



The following is my code:

Private Sub Form_Load()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sSQLAs String

Set cn = New ADODB.Connection
cn.ConnectionString = "provider =Microsoft.Jet.OLEDB.4.0; " & _
"data source = \\servername\DatabaseName.mdb;" & _
"pwd=password;"

cn.Open
Set rs = New ADODB.Recordset
sSQL= "SELECT * FROM table;"

rs.Open sSQL, cn

rs.MoveFirst
Combo1.Clear

Do While Not rs.EOF
Combo1.AddItem rs!field_name
rs.MoveNext
Loop

End Sub


Thanks in advance for your help.

John

Johnny101
July 26th, 2000, 03:14 PM
if you supply a password, you should also supply a user name - Admin by default, i think for Access. If that doesn't work, then add the driver name "Driver={Microsoft Access Driver (*.mdb)};".

hope this helps,

John

John Pirkey
MCSD
http://www.ShallowWaterSystems.com
http://www.stlvbug.org

sathyanr
July 27th, 2000, 01:31 AM
Hi..

Hope the following code helps u..

Instead of this
cn.ConnectionString = "provider =Microsoft.Jet.OLEDB.4.0; " & _
"data source = \\servername\DatabaseName.mdb;" & _
"pwd=password;"

use
cn.ConnectionString = "provider =Microsoft.Jet.OLEDB.4.0; " & _
"data source = \\servername\DatabaseName.mdb;" & _
"Jet OLEDB:Database Password=password;"

Regards
Sathya

July 27th, 2000, 04:30 PM
Thanks A lot for your help.