Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error: provider cannot be found

Status
Not open for further replies.

blurworld

Programmer
Sep 19, 2001
46
0
0
GB
Hi,
After running the following below in vb6 i get...

"Run-time error '3706'
Provider cannot be found. It may not be properly installed."

with "recPerson.Open strSQL, strConnect" then highligted in the debug...

what am i doing wrong? any ideas thanx
-Martin

Public Sub Load(SSN As String)
Dim recPerson As Recordset
Dim strConnect As String
Dim strSQL As String
strConnect = "Provider=Microsoft.Jet.OLEDB.3.51;" & _
"Persist Security Info=False;" & _
"Data Source=C:person.mdb"
strSQL = "SELECT * FROM Person WHERE SSN='" & SSN & "'"
Set recPerson = New RecordSet
recPerson.Open strSQL, strConnect

With recPerson
If Not .EOF And Not .BOF Then
udtPerson.SSN = .Fields("SSN")
udtPerson.Name = .Fields("Name")
udtPerson.Birthdate = .Fields("Birthdate")
Else
recPerson.Close
Err.Raise vbObjectError + 1002, "Person", "SSN not on file"
End If
End With

recPerson.Close
Set recPerson = Nothing
End Sub
 
Probably just a typo, but...
"Data Source=C:person.mdb"

should be
"Data Source=C:\person.mdb".

Have you tried using a UDL file? Simply create a file with a udl extension and double click on it. This will bring up a wizard that will guide you through building a connection string. Once you've done that you can either using the file as the connection string itself (I can't check here I think it's &quot;file=<filename>;&quot;), or just open the file in notepad and copy the connection string stored inside.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top