 | 
28-Jul-2006, 08:17 AM
|  | Guest | | | | | | | | | | Run-time error '13': Type mismatch This one is driving me mad! The database I'm working with is meant to
download data into Publisher to create posters, I have one version that Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/10969-run-time-error-13-type-mismatch.html
works and one that gives me the Run-time error. The query works, the code
looks right, and just to make life interesting, I created a new copy of the
database importing all of the tables, queries, forms, posters and macros from
the version that works, and I still get the same error message! I know this
isn't much info, but if anyone else has come across anything similar, at Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10969
least I won't feel like I'm going completely mad!! Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh! | 
28-Jul-2006, 08:17 AM
|  | Guest | | | | | | | | | | Re: Run-time error '13': Type mismatch "calmo" wrote in message Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10969
news:A03AE088-A32C-478F-9170-3362F883CF4A@microsoft.com
> This one is driving me mad! The database I'm working with is meant to
> download data into Publisher to create posters, I have one version
> that works and one that gives me the Run-time error. The query
> works, the code looks right, and just to make life interesting, I
> created a new copy of the database importing all of the tables,
> queries, forms, posters and macros from the version that works, and I
> still get the same error message! I know this isn't much info, but
> if anyone else has come across anything similar, at least I won't
> feel like I'm going completely mad!!
It would help a lot if you posted the line of code that is raising the
error. I do have one guess: we often see questions about this error
that are due to a confusion over the Recordset type. For example, in an
Access 2000 or 2002 database, there will be code like this:
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset(" ... ")
and the error will be raised on the call to OpenRecordset. That's
caused by A2K/A2K2 not having a default reference set to the DAO
library, but instead having a reference to the ADODB library. Both of
those libraries define a Recordset object, but they're not compatibile. Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10969
So in the above code, the declaration is understood by VBA as making rs
an ADODB.Recordset, but the OpenRecordset method returns a DAO
recordset. So you get a type mismatch error.
If this is your problem, you must first use the Tools -> References...
dialog to add a reference to the Microsoft DAO 3.6 Object Library (if it
isn't there already), and then *either* remove the reference to ActiveX
Data Objects 2.x Library (if you don't plan to use ADO) *or* change your
declaration of the recordset to:
Dim rs As DAO.Recordset
By explicitly identifying the library whose Recordset object you're
declaring, you remove the confusion.
There are other objects that are defined in both libraries and can cause
confusion. The full list is:
Connection
Error
Errors
Field
Fields
Parameter
Parameters
Property
Properties
Recordset
Note: the following objects exist with the same names in the ADOX and
DAO models as well:
Group
Groups
Index
Indexes
Property
Properties
User
Users
--
Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup) | 
28-Jul-2006, 08:17 AM
|  | Guest | | | | | | | | | | Re: Run-time error '13': Type mismatch Any possibility of Null values being assigned to non-variant variables?
Any possibility of division by zero?
--
Doug Steele, Microsoft Access MVP http://I.Am/DougSteele
(no e-mails, please!)
"calmo" wrote in message Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10969
news:A03AE088-A32C-478F-9170-3362F883CF4A@microsoft.com...
> This one is driving me mad! The database I'm working with is meant to
> download data into Publisher to create posters, I have one version that Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10969
> works and one that gives me the Run-time error. The query works, the code
> looks right, and just to make life interesting, I created a new copy of
the
> database importing all of the tables, queries, forms, posters and macros
from
> the version that works, and I still get the same error message! I know
this
> isn't much info, but if anyone else has come across anything similar, at
> least I won't feel like I'm going completely mad!! | 
28-Jul-2006, 08:17 AM
|  | Guest | | | | | | | | | | Re: Run-time error '13': Type mismatch Brilliant! Removing the ADO worked a treat. Thanks for your help.
"Dirk Goldgar" wrote:
> "calmo" wrote in message
> news:A03AE088-A32C-478F-9170-3362F883CF4A@microsoft.com
> > This one is driving me mad! The database I'm working with is meant to Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10969
> > download data into Publisher to create posters, I have one version
> > that works and one that gives me the Run-time error. The query
> > works, the code looks right, and just to make life interesting, I
> > created a new copy of the database importing all of the tables,
> > queries, forms, posters and macros from the version that works, and I
> > still get the same error message! I know this isn't much info, but
> > if anyone else has come across anything similar, at least I won't
> > feel like I'm going completely mad!!
>
> It would help a lot if you posted the line of code that is raising the
> error. I do have one guess: we often see questions about this error
> that are due to a confusion over the Recordset type. For example, in an Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=10969
> Access 2000 or 2002 database, there will be code like this:
>
> Dim rs As Recordset
>
> Set rs = CurrentDb.OpenRecordset(" ... ")
>
> and the error will be raised on the call to OpenRecordset. That's
> caused by A2K/A2K2 not having a default reference set to the DAO
> library, but instead having a reference to the ADODB library. Both of
> those libraries define a Recordset object, but they're not compatibile.
> So in the above code, the declaration is understood by VBA as making rs
> an ADODB.Recordset, but the OpenRecordset method returns a DAO
> recordset. So you get a type mismatch error.
>
> If this is your problem, you must first use the Tools -> References...
> dialog to add a reference to the Microsoft DAO 3.6 Object Library (if it
> isn't there already), and then *either* remove the reference to ActiveX
> Data Objects 2.x Library (if you don't plan to use ADO) *or* change your
> declaration of the recordset to:
>
> Dim rs As DAO.Recordset
>
> By explicitly identifying the library whose Recordset object you're
> declaring, you remove the confusion.
>
> There are other objects that are defined in both libraries and can cause
> confusion. The full list is:
>
> Connection
> Error
> Errors
> Field
> Fields
> Parameter
> Parameters
> Property
> Properties
> Recordset
>
> Note: the following objects exist with the same names in the ADOX and
> DAO models as well:
>
> Group
> Groups
> Index
> Indexes
> Property
> Properties
> User
> Users
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>
> | 
Support Us! Become a Promoter! | | Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh! | (View-All)
Members who have read this thread : 0
| | There are no names to display. | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Tools | Search | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On | | | | » Active Discussions | | | | | | | | | | | | | | | | | | | Panjabi Today 02:27 AM 11 Replies, 232 Views | | | | | | | | | | | » Books You Should Read... | | | |