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!

Converting a db to Access 97

Status
Not open for further replies.

Tobasco1136

IS-IT--Management
Jun 7, 2007
29
0
0
US
I developed a database in Access 2003 and then tried to convert it to Access 97 for users that only have that version. I have done this before and it worked fine. However on this current database, I get the following error:

Compile error:
Method or data member not found.

It seems to hang up on the following section. I changed the number of ConNumButtons from 8 to 10 as that is how many buttons are on the switchboard.

There also seems to be an issue with this command:
Set con = Application.CurrentProject.Connection


Private Sub FillOptions()
' Fill in the options for this switchboard page.

' The number of buttons on the form.
Const conNumButtons = 10

Dim con As Object
Dim rs As Object
Dim stSql As String
Dim intOption As Integer

' Set the focus to the first button on the form,
' and then hide all of the buttons on the form
' but the first. You can't hide the field with the focus.


' Open the table of Switchboard Items, and find
' the first item for this Switchboard Page.
Set con = Application.CurrentProject.Connection
stSql = "SELECT * FROM [Switchboard Items]"
stSql = stSql & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
stSql = stSql & " ORDER BY [ItemNumber];"
Set rs = CreateObject("ADODB.Recordset")
rs.Open stSql, con, 1 ' 1 = adOpenKeyset

' If there are no options for this Switchboard Page,
' display a message. Otherwise, fill the page with the items.
If (rs.EOF) Then
Else
While (Not (rs.EOF))
Me("Option" & rs![ItemNumber]).Visible = True
Me("OptionLabel" & rs![ItemNumber]).Visible = True
Me("OptionLabel" & rs![ItemNumber]).Caption = rs![ItemText]
rs.MoveNext
Wend
End If

' Close the recordset and the database.
rs.Close
Set rs = Nothing
Set con = Nothing

End Sub
 
Hi
To begin "Application.CurrentProject.Connection" is refereing to the ADO library

In Access97 this was not routinely loaded, since DAO was the default Database access method.

So, try checking your references to ensure you have ADO library selected

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Furthermore I don't think that the ac97's Application object exposes a CurrentProject property at all ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I don't know enough about Access to fix this issue. Is there something I need to do in 2003 before I convert the db to 97? It seems to mainly be an issue with the switchboard, but I don't know what to do now.
 
If you have to deploy 97's db then develop with ac97 ...
 
Have to agree with PHV, always develop in the "oldest" version. Software is usually forward compatible, but seldom is it backward compatible. In other words anything developed in A97 will almost certainly run in A2003, but the reverse is frequently not true (as you have found)

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top