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

Converting Access 97 to 2000

Status
Not open for further replies.

vpnsymech

Programmer
Mar 26, 2002
5
US
Hello:

I am trying to convert Access 97 basic to Access 2000 visual basic.

The following code is not converting, and returning an error on the line line that states:
Dim db As Database

"Compile Error."
"User-defined type not defined"

Here is the code.

Dim db As Database <<<---Here is the error in the code|||
Dim rst As Recordset

Set db = CurrentDb
Set rst = db.OpenRecordset(&quot;tbl_visitor&quot;)
Dim newID As Integer
With rst

.AddNew
newID = !visitorID
!firstname = Me.TextFirstNameV.Value
!lastname = Me.TextLastNameV.Value
!employeefirstname = Me.TextFirstNameE.Value
!employeeLastname = Me.TextLastNameE.Value
!company = Me.TextCompany.Value
!Date = Now
!reasonforvisit = Me.TextVisitPurpose.Value
!agreedToTerms = True

.Update

.Close

End With
 
The object Database no longer works in Access 2000 due to the object model changes. Change the statement to read:

Dim db as DAO.Database
 
Thanks for the help.

I tried this modification, and I still get an error.

I have both access 97 and access 2000 installed on my machine. Could this be a potential problem?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top