Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

Microsoft DAO 3.51 Object library Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BCP - 28 Dec 2005 16:49 GMT
I have been having a problem with MS Access over the last several days.  One
of the associated dll files is not working properly.  An error is encountered
with existing code.  To correct the error I reselect the reference(dll) for
Microsoft DAO 3.51 Object library and the application began returning error
messages on code that was not modified.  The problem first happened in an
Access 97 application.  Then it occured in an Access 2000 application that
uses SQL Server tables.  The problem presented itdself on three seperate
computers.

Here is the code I ran and the error I got.

Sub Report1(StartDate As Date, EndDate As Date)
Dim db As Database, rst As Recordset, SQL As String, SQL2 As String, I As
Integer
Dim Division As String, QDF As QueryDef, qn As String

Set db = CurrentDb

SQL = "SELECT Division.Description FROM Division;"
Set rst = db.OpenRecordset(SQL, dbOpenDynaset)

Returns - Error Number - 13
               Error Description - Type mismatch

Any suggestions are most welcome.
BCP
Dirk Goldgar - 28 Dec 2005 17:05 GMT
> I have been having a problem with MS Access over the last several
> days.  One of the associated dll files is not working properly.  An
[quoted text clipped - 21 lines]
>
> Any suggestions are most welcome.

First, if you're using Access 2000, you should be using DAO 3.6, not
3.51.  Second, the type of error you're getting is seen most commonly
when the project also has a reference set to ADO (Microsoft ActiveX Data
Objects 2.x Library).  In that case, it occurs because both the DAO and
ADO libraries define a Recordset object, and the two objects are not
compatible.  We normally don't see this error in Access 97, because that
version doesn't include reference to ADO by default;  however, Access
2000 does.

If this is the problem, and you're not using ADO in your database,
remove the reference to ADO, leaving just the reference to DAO.  If you
*are* using both ADO and DAO, qualify all declarations of the following
object types with either "DAO." or "ADODB.", as appropriate:

   Connection
   Error
   Errors
   Field
   Fields
   Parameter
   Parameters
   Property
   Properties
   Recordset

It's most often the Recordset object that bites you, though.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

BCP - 28 Dec 2005 17:27 GMT
Worked like a charm.  Thank you for your help.

> > I have been having a problem with MS Access over the last several
> > days.  One of the associated dll files is not working properly.  An
[quoted text clipped - 48 lines]
>
> It's most often the Recordset object that bites you, though.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.