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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can upgrading to SP5 cause connection errors to Access 97?

Status
Not open for further replies.

jofarrell

Programmer
Mar 21, 2001
178
US
I connect to my database using :

Set DbsNew = DBEngine.Workspaces(0).OpenDatabase(App.Path & "\LegalTracking")

yet doing this exactly the same way on anothe rproject and calling a recordset exactly the same way yields a "runtime error 13"

at the sql statement.

Public Function chkValidNum(Num As Long) As Boolean
Dim rsCheckNum As Recordset

Dim Checker As Boolean

SQL = "SELECT ContactID " _
& "FROM tblContact " _
& "WHERE tblContact.[ContactId] = " & Num
Set rsCheckNum = DbsNew.OpenRecordset(SQL, dbOpenDynaset)
If Not rsCheckNum.EOF Then
Checker = True
Else
Checker = False
End If
rsCheckNum.Close
Set rsCheckNum = Nothing
chkValidNum = Checker
End Function

Any suggestions at all on how I can fix this as it works in some projects and not in others??
 
I hope this isn't overly simplistic, but have you checked your references; specifically, are you referencing the same version of DAO in each project (3.5 vs 3.6)?
 
Are they backward compatible?

ut yes I have 3.6 checked for DAO compatibility, I am thinking about going back and checking the 2.51/3.5 one to see if it will help.

Any other suggestions?

Joanne
 
Ok I figured it out. It was a reference problem but not with the DOA refernce. I was missing the Microsoft Data Source Interfaces reference. In case anyone else has similar problems and thinks they are going crazy :):)

Joanne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top