Unrecognized database format <filename>. (Error 3343)

M

mramani

We recently converted from Office 97 to Office 2003. The macro in word97
worked greate in accessing Access97 database, but after the conversion the
marco gives the following error message.
Database is also converted.

Unrecognized database format <filename>. (Error 3343)

here is part of the coding:

Dim db As Database
Message = "Enter CASE NUMBER" ' Set prompt.
Title = "InputBox Demo" ' Set title.
Default = "0001" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)
' Display Selection
' Selection.InsertBefore Text:=MyValue
If ActiveDocument.Bookmarks.Exists("caption") = True Then
ActiveDocument.Bookmarks("caption").Select
End If
'this where the error message happens.
Set db = OpenDatabase(Name:="O:\Databases\Database\PSCCases2003.mdb")
'Set rs = db.OpenRecordset(Name:="casecaptions")
Set rs = db.OpenRecordset("SELECT CaseCaptions.[Case Number],
CaseCaptions.Caption_for_case FROM CaseCaptions where [Case Number] = '" &
MyValue & "'")
NumRec = rs.RecordCount
 
P

Perry

Did you convert the database to 2003 format ?
If not, the error msg y're reporting usually is caused by this ...
Converting/porting yr Access 97 to Access 2003 will most likely solve the
problem.

However, Access could report problems during conversion.
In such case, look at:
Replace passages in yr Access 97 code reading:
Dim rs as Recordset
to read
Dim rs as DAO.recordset

This goes for every DAO object variable, that could be part of another
library.

If you use object variables both present in DAO- as well as ADO interface.
you will have to direct the VBA compiler to the correct interface y're
trying to invoke properties/methods from.
You'll have to take this in account moving from Access 97 to every Access 97
successor
because DAO isn't the default data access interface.

Other example:
If both DAO- and ADOX library are present in yr are Access or Word VBA
projects

Replace
Dim tbl as table '< ok in Access/Word 97
to
Dim tbl as DAO.table '< correct DAO table declaration
(Table is also part of the ADOX extensibility library...)

In other words, if you want to use an object variable
to represent a Table part of the DAO interface, use
Dim tbl as DAO.table

If you want to use an object variable to represent a Table
part of the ADOX interface use
Dim tbl as ADOX.Table

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE



mramani said:
We recently converted from Office 97 to Office 2003. The macro in word97
worked greate in accessing Access97 database, but after the conversion the
marco gives the following error message.
Database is also converted.

Unrecognized database format <filename>. (Error 3343)

here is part of the coding:

Dim db As Database
Message = "Enter CASE NUMBER" ' Set prompt.
Title = "InputBox Demo" ' Set title.
Default = "0001" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)
' Display Selection
' Selection.InsertBefore Text:=MyValue
If ActiveDocument.Bookmarks.Exists("caption") = True Then
ActiveDocument.Bookmarks("caption").Select
End If
'this where the error message happens.
Set db = OpenDatabase(Name:="O:\Databases\Database\PSCCases2003.mdb")
'Set rs = db.OpenRecordset(Name:="casecaptions")
Set rs = db.OpenRecordset("SELECT CaseCaptions.[Case Number],
CaseCaptions.Caption_for_case FROM CaseCaptions where [Case Number] = '" &
MyValue & "'")
NumRec = rs.RecordCount
 

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