File Format Problem - I think!

B

Bill Hall

Hi

Over the last few years, I have been personalising the Microsoft Access 97
“Students & Classes†template to suit my current teaching needs. Everything
has been going good!

As each teacher in our school has recently been given a new laptop, so the
version of Access has changed to the 2003 edition of the application.

I converted my database file using the Access Tools → Database Utilities →
Convert Databases → To Access 2002 – 2003 File Format facility.

However, when I open the newly converted file, the following dialogue box
opens:

“Your Microsoft Office Access database or project contains missing or broken
reference to the file ‘DAO30.DLL’ version 5.0â€

Going OK, I get into edit code mode, with the first DIM line highlighted grey

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

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

Dim dbs As Database
Dim rst As Recordset
Dim strSQL 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.
Me![Option1].SetFocus
For intOption = 2 To conNumButtons
Me("Option" & intOption).Visible = False
Me("OptionLabel" & intOption).Visible = False
Next intOption

' Open the table of Switchboard Items, and find
' the first item for this Switchboard Page.
Set dbs = CurrentDb()
strSQL = "SELECT * FROM [Switchboard Items]"
strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" &
Me![SwitchboardID]
strSQL = strSQL & " ORDER BY [ItemNumber];"
Set rst = dbs.OpenRecordset(strSQL)

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

' Close the recordset and the database.
rst.Close
dbs.Close

End Sub

As my basic programming is not strong enough to sort this out, could anyone
please try to help me with this problem.

Many thanks

Bill
 
D

Douglas J. Steele

With any code module open, select Tools | References from the menu bar,
scroll through the list of available references until you find the one for
Microsoft DAO 3.6 Object Library, and select it. Since your application was
written in Access 97, you wouldn't have been using ADO, so you should also
uncheck the reference to Microsoft ActiveX Data Objects 2.1 Library

If you have both references, you'll find that you'll need to "disambiguate"
certain declarations, because objects with the same names exist in the 2
models. For example, to ensure that you get a DAO recordset, you'll need to
use Dim rsCurr as DAO.Recordset (to guarantee an ADO recordset, you'd use
Dim rsCurr As ADODB.Recordset)

The list of objects with the same names in the 2 models is Connection,
Error, Errors, Field, Fields, Parameter, Parameters, Property, Properties
and Recordset



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Bill Hall said:
Hi

Over the last few years, I have been personalising the Microsoft Access 97
"Students & Classes" template to suit my current teaching needs.
Everything
has been going good!

As each teacher in our school has recently been given a new laptop, so the
version of Access has changed to the 2003 edition of the application.

I converted my database file using the Access Tools ? Database Utilities ?
Convert Databases ? To Access 2002 - 2003 File Format facility.

However, when I open the newly converted file, the following dialogue box
opens:

"Your Microsoft Office Access database or project contains missing or
broken
reference to the file 'DAO30.DLL' version 5.0"

Going OK, I get into edit code mode, with the first DIM line highlighted
grey

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

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

Dim dbs As Database
Dim rst As Recordset
Dim strSQL 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.
Me![Option1].SetFocus
For intOption = 2 To conNumButtons
Me("Option" & intOption).Visible = False
Me("OptionLabel" & intOption).Visible = False
Next intOption

' Open the table of Switchboard Items, and find
' the first item for this Switchboard Page.
Set dbs = CurrentDb()
strSQL = "SELECT * FROM [Switchboard Items]"
strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" &
Me![SwitchboardID]
strSQL = strSQL & " ORDER BY [ItemNumber];"
Set rst = dbs.OpenRecordset(strSQL)

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

' Close the recordset and the database.
rst.Close
dbs.Close

End Sub

As my basic programming is not strong enough to sort this out, could
anyone
please try to help me with this problem.

Many thanks

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top