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? 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
erson.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
"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? 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
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