473,778 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Type Mismatch Error Fixed when Move ADO reference up - Why?

I have an A2K database that has links to 3 of my other databases
(external links) to run some reports. The coding in any of the 4 is
pretty simple.

Recently when we make a new .mde for the "main" database, the first
time we run our reports (all executed from code from a form), we get a
Type Mismatch Error on the line:

Set db = CurrentDb

I go into Tools/References and move MS DAO 3.6 up above my external DB
references and above OLE automation, and make a new mde.
The problem goes away.

The problem is occuring in the MAIN db (not any of the referenced dbs).
The only thing that has changed is that we started using Access 2003 to
do some editing. Of course, we use A2K to make the mde.

Anyone have any thoughts? Aside from the fact that it's annoying, I am
worried something else is wrong and I'm just lucky to have it fixed
with the move of the reference.

Thanks
sara

Aug 24 '06 #1
4 2281
Each version of Access uses a different binary for the compiled version of
the code. They are backwards compatible (e.g. Access 2003 can read an Access
2002/3 format file compiled into an mde on Access 2002, but not the other
way around.) So, when you have been editing the MDB on 2003, and then open
it in 2000, Access is supposed to silently recompile in the 2000 code, and
everything should run sweetly. In practice that does not happen reliably.

We have found it necessary to explicitly decompile whenever you switch back
to an older version. To decompile, make a backup copy, and enter something
like this at the command prompt while Access is not running. It is all one
line, and include the quotes:
"c:\Program Files\Microsoft office\office\m saccess.exe" /decompile
"c:\MyPath\MyDa tabase.mdb"
Then restart Access (without running any startup code, e.g. hold down the
Shift key), and compact (again holding down Shift.) Then open in the old
version.

It may also help to be explicit about the libaray you want when you declare
references that could be another library, e.g.:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim fld As DAO.Field

And the other crucial aspect is to make sure all versions have at least SP8
for JET 4:
http://support.microsoft.com/kb/239114

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"sara" <sa*******@yaho o.comwrote in message
news:11******** *************@7 4g2000cwt.googl egroups.com...
>I have an A2K database that has links to 3 of my other databases
(external links) to run some reports. The coding in any of the 4 is
pretty simple.

Recently when we make a new .mde for the "main" database, the first
time we run our reports (all executed from code from a form), we get a
Type Mismatch Error on the line:

Set db = CurrentDb

I go into Tools/References and move MS DAO 3.6 up above my external DB
references and above OLE automation, and make a new mde.
The problem goes away.

The problem is occuring in the MAIN db (not any of the referenced dbs).
The only thing that has changed is that we started using Access 2003 to
do some editing. Of course, we use A2K to make the mde.

Anyone have any thoughts? Aside from the fact that it's annoying, I am
worried something else is wrong and I'm just lucky to have it fixed
with the move of the reference.

Thanks
sara

Aug 24 '06 #2
Thank you, Allen. I'm so glad it's not me!

There are only 2 of us who even write queries and reports (and I am the
only one who writes code), and IT wanted us to upgrade to 2003,
thinking that it would be simple, and he could upgrade to 2003 for new
users. I suspected this wasn't a "workable plan", and you have now
confirmed that for us. THANKS!

Also, I have been using your Change Tracking with tremendous success -
thanks for that, too. It is really easy to install and use. At an
upcoming user group meeting, one of the group's organizers said he'd
explain what all your code was doing as well.

Thanks for all your help! I'd never have made it this far without it.
Sara
Allen Browne wrote:
Each version of Access uses a different binary for the compiled version of
the code. They are backwards compatible (e.g. Access 2003 can read an Access
2002/3 format file compiled into an mde on Access 2002, but not the other
way around.) So, when you have been editing the MDB on 2003, and then open
it in 2000, Access is supposed to silently recompile in the 2000 code, and
everything should run sweetly. In practice that does not happen reliably.

We have found it necessary to explicitly decompile whenever you switch back
to an older version. To decompile, make a backup copy, and enter something
like this at the command prompt while Access is not running. It is all one
line, and include the quotes:
"c:\Program Files\Microsoft office\office\m saccess.exe" /decompile
"c:\MyPath\MyDa tabase.mdb"
Then restart Access (without running any startup code, e.g. hold down the
Shift key), and compact (again holding down Shift.) Then open in the old
version.

It may also help to be explicit about the libaray you want when you declare
references that could be another library, e.g.:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim fld As DAO.Field

And the other crucial aspect is to make sure all versions have at least SP8
for JET 4:
http://support.microsoft.com/kb/239114

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"sara" <sa*******@yaho o.comwrote in message
news:11******** *************@7 4g2000cwt.googl egroups.com...
I have an A2K database that has links to 3 of my other databases
(external links) to run some reports. The coding in any of the 4 is
pretty simple.

Recently when we make a new .mde for the "main" database, the first
time we run our reports (all executed from code from a form), we get a
Type Mismatch Error on the line:

Set db = CurrentDb

I go into Tools/References and move MS DAO 3.6 up above my external DB
references and above OLE automation, and make a new mde.
The problem goes away.

The problem is occuring in the MAIN db (not any of the referenced dbs).
The only thing that has changed is that we started using Access 2003 to
do some editing. Of course, we use A2K to make the mde.

Anyone have any thoughts? Aside from the fact that it's annoying, I am
worried something else is wrong and I'm just lucky to have it fixed
with the move of the reference.

Thanks
sara
Aug 24 '06 #3
That's great, Sara.

It's worth experimenting with the /Decompile.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"sara" <sa*******@yaho o.comwrote in message
news:11******** *************@b 28g2000cwb.goog legroups.com...
Thank you, Allen. I'm so glad it's not me!

There are only 2 of us who even write queries and reports (and I am the
only one who writes code), and IT wanted us to upgrade to 2003,
thinking that it would be simple, and he could upgrade to 2003 for new
users. I suspected this wasn't a "workable plan", and you have now
confirmed that for us. THANKS!

Also, I have been using your Change Tracking with tremendous success -
thanks for that, too. It is really easy to install and use. At an
upcoming user group meeting, one of the group's organizers said he'd
explain what all your code was doing as well.

Thanks for all your help! I'd never have made it this far without it.
Sara
Allen Browne wrote:
>Each version of Access uses a different binary for the compiled version
of
the code. They are backwards compatible (e.g. Access 2003 can read an
Access
2002/3 format file compiled into an mde on Access 2002, but not the other
way around.) So, when you have been editing the MDB on 2003, and then
open
it in 2000, Access is supposed to silently recompile in the 2000 code,
and
everything should run sweetly. In practice that does not happen reliably.

We have found it necessary to explicitly decompile whenever you switch
back
to an older version. To decompile, make a backup copy, and enter
something
like this at the command prompt while Access is not running. It is all
one
line, and include the quotes:
"c:\Program Files\Microsoft office\office\m saccess.exe" /decompile
"c:\MyPath\MyDa tabase.mdb"
Then restart Access (without running any startup code, e.g. hold down the
Shift key), and compact (again holding down Shift.) Then open in the old
version.

It may also help to be explicit about the libaray you want when you
declare
references that could be another library, e.g.:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim fld As DAO.Field

And the other crucial aspect is to make sure all versions have at least
SP8
for JET 4:
http://support.microsoft.com/kb/239114

"sara" <sa*******@yaho o.comwrote in message
news:11******* **************@ 74g2000cwt.goog legroups.com...
>I have an A2K database that has links to 3 of my other databases
(external links) to run some reports. The coding in any of the 4 is
pretty simple.

Recently when we make a new .mde for the "main" database, the first
time we run our reports (all executed from code from a form), we get a
Type Mismatch Error on the line:

Set db = CurrentDb

I go into Tools/References and move MS DAO 3.6 up above my external DB
references and above OLE automation, and make a new mde.
The problem goes away.

The problem is occuring in the MAIN db (not any of the referenced dbs).
The only thing that has changed is that we started using Access 2003 to
do some editing. Of course, we use A2K to make the mde.

Anyone have any thoughts? Aside from the fact that it's annoying, I am
worried something else is wrong and I'm just lucky to have it fixed
with the move of the reference.

Thanks
sara

Aug 24 '06 #4
"sara" <sa*******@yaho o.comwrote in
news:11******** *************@7 4g2000cwt.googl egroups.com:
Recently when we make a new .mde for the "main" database, the
first time we run our reports (all executed from code from a
form), we get a Type Mismatch Error on the line:

Set db = CurrentDb

I go into Tools/References and move MS DAO 3.6 up above my
external DB references and above OLE automation, and make a new
mde. The problem goes away.
That makes no sense to me at all, as DAO is not necessary to use
CurrentDB, as it is available both through DAO and as a property of
the Application object.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Aug 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6601
by: Chris | last post by:
Hi everyone, I have an error message in an Access 97 database & I was hoping someone may be able to help me get rid of it (bearing in mind I only have an average understanding of Access & absolutely none of VB coding). Originally, this database was in Access 2003 format. I opened it in 2003, then used the convert option to back it down to Access 97. I then opened it in 97. Upon opening, I get this error message: "compile error:...
1
4618
by: MovnOn | last post by:
I'm writing a program that uses a COM object. If I were writing this code in VB6, the signature of the method of the COM object I need to use would be: saveMemo (Collection) The method takes a collection as the parameter. I did a tblimp (I get the same results if I add the COM object as a reference) on the COM object and when I use this in .NET, the same method has a signature of: saveMemo (Object) and the Object is passed ByRef.
1
2047
by: jodyblau | last post by:
I am getting a type mismatch message under strange circumstances. Here's whats going on: 1. I have split the database into a front end and a back end. 2. I have compiled the project. 3. I update the linked tables and then make an mde file. 4. When I use the mdb file, everything seems to work fine.
0
1339
by: Rob R. Ainscough | last post by:
I'm getting a bizarre error in the IDE Error List: ****** The Error message ******* Value of type 'MyDLL.Customer' cannot be converted to 'MyDLL.Customer'. Type mismatch could be due to the mixing of a file reference with a project reference to assembly 'MyDLL'. Try replacing the file reference to 'MyDLL.dll' in project '16_Secure_Billing.aspx' with a project reference to MyDLL'. ****************************
2
2709
by: Søren M. Olesen | last post by:
Hi I starting to get the following compiler error, but I really don't know how to resolve it. Value of type 'DXP.Shared.myPath' cannot be converted to 'DXP.Shared.myPath'. Type mismatch could be due to the mixing of a file reference with a project reference to assembly 'DXP.Shared'. Try replacing the file reference to 'DXP.Shared.dll' in project '2_App_Code' with a
2
1932
by: Deano | last post by:
I'm really worried my db is falling apart! I'm now getting; "Run-time error: 13 Type mismatch" When I run faq_DisableShiftKeyBypass in the immediate window. This is a
7
2450
by: BlackMustard | last post by:
hi all, i have used the following macro to move unimportant (i.e. non-work related) mail in my outlook inbox into a folder in personal folders. it has worked for a long time, but suddenly it gives a "type mismatch" error when trying to move the mailitem. Sub UnimportantMail() Dim myTargetFolder As MAPIFolder Dim myCurrentItem As Outlook.MailItem Set myCurrentItem = Application.ActiveExplorer.Selection Set...
22
1670
by: Ruben | last post by:
Why would a method that is defined to return a reference such as with the operator overload of , operator, href& operator(int index){ return _array; } not cause a type mismatch compiler error? Ruben
19
5547
by: zz12 | last post by:
Hello, is there a setting in IIS 5.0 that would quickly fix the following error?: Microsoft VBScript runtime (0x800A000D) Type mismatch It's strange because some of our .asp pages were working fine for the past years but recently our website was updated in that old folders were renamed and the new ones took on the existing name and was wondering why some our ..asp pages are now returning this error? I would think that since the code
0
9470
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10127
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8957
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7475
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5500
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2865
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.