Are objects and methods the same from 97 to 2000? (1 Viewer)

robert693

Registered User.
Local time
Today, 22:36
Joined
Mar 22, 2001
Messages
38
I have a module that concatenates names and addresses. I built it on Access 97. When I try to run it on Access 2000 certain objects such as "Table" are not recognized. Same with "index". I was wondering if this has to do with a difference between 97 and 2000 because the module works fine on 97. This is the module:

Function Mashit()
Dim CRLF As Variant, TheDB As Database, Tb1 As Table
Dim N1 As String, N2 As String, N3 As String
Set TheDB = CurrentDb()
Set Tb1 = TheDB.OpenTable("LEADS")
Tb1.Index = "Last Name"
Tb1.MoveFirst
CRLF = Chr(13) & Chr(10)
Do Until Tb1.EOF
If IsNull(Tb1("Mashed")) Then
If Not IsNull(Tb1("First Name")) Then
If Not IsNull(Tb1("Company")) Then
If Not IsNull(Tb1("Address 2")) Then
N1 = Tb1("First Name") & " " & Tb1("Middle Initial") & " " & Tb1("Last Name")
N2 = Tb1("Company") & CRLF & Tb1("Address 1")
N3 = Tb1("Address 2") & CRLF & Tb1("City") & ", " & Tb1("State") & " " & Tb1("Zip") & " " & Tb1("Country")
Tb1.Edit
Tb1("Mashed") = N1 & CRLF & N2 & CRLF & N3
Tb1.Update
Else
N1 = Tb1("First Name") & " " & Tb1("Middle Initial") & " " & Tb1("Last Name")
N2 = Tb1("Company") & CRLF & Tb1("Address 1")
N3 = Tb1("City") & ", " & Tb1("State") & " " & Tb1("Zip") & " " & Tb1("Country")
Tb1.Edit
Tb1("Mashed") = N1 & CRLF & N2 & CRLF & N3
Tb1.Update
End If
Else
If Not IsNull(Tb1("Address 2")) Then
N1 = Tb1("First Name") & " " & Tb1("Middle Initial") & " " & Tb1("Last Name")
N2 = Tb1("Address 1") & CRLF & Tb1("Address 2")
N3 = Tb1("City") & ", " & Tb1("State") & " " & Tb1("Zip") & " " & Tb1("Country")
Tb1.Edit
Tb1("Mashed") = N1 & CRLF & N2 & CRLF & N3
Tb1.Update
Else
N1 = Tb1("First Name") & " " & Tb1("Middle Initial") & " " & Tb1("Last Name")
N2 = Tb1("Address 1")
N3 = Tb1("City") & ", " & Tb1("State") & " " & Tb1("Zip") & " " & Tb1("Country")
Tb1.Edit
Tb1("Mashed") = N1 & CRLF & N2 & CRLF & N3
Tb1.Update
End If
End If
End If
End If
Tb1.MoveNext
Loop
Tb1.Close

End Function
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:36
Joined
Feb 19, 2002
Messages
43,301
You may be running into the DAO/ADO confusion. Prefix all the DAO objects with DAO.

DAO.Database
DAO.Table
etc.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:36
Joined
Feb 28, 2001
Messages
27,192
You might also have a problem introduced when you converted the database from 97 to 2K. I know I had this same problem.

Your DAO library in AC97 is something like dao2535.tlb (the 2.5/3.5 compatibility library.) But this library is not present for AC2K. You need the dao36.tlb (version 3.6 dao library.) When you convert from AC97 to AC2K, the references apparently do not get changed automatically.

To correct this problem, open up a module window in design mode, then select Tools >> References and see if anything is missing. (You should be missing DAO2535.TLB). Browse in the \Program Files\Common Files\Microsoft Shared\DAO\ directory.

When you find the file in the browser window, double-click it. It will become a reference. Then try to recompile all modules in your database. This should clear up a lot of problems.
 

Jacob Mathai

Registered User.
Local time
Today, 22:36
Joined
Sep 6, 2001
Messages
546
Select a module in design. Then click on Tools and the reference.
This is what we have checked:
Visual Basic for Applications
Microsoft ACCESS 9.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft Scripting Runtime
Microsoft Visual Basic for Applications Extensibility 5.3
Microsoft VB script Globals
Microsoft Office 9.0 Object Library

Note : The order is important. Change order, if needed, on your reference list. Then compile your module.
 

Users who are viewing this thread

Top Bottom