2007 messed up my 2003 code...?

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I am a pretty seasoned MS Access Developer, and (at the moment) I
will not go into the details of my code, etc. I'll do that later if
nobody seems familiar with my issue. i have an MS Access 2003 DB with
lots of code, forms, queries, etc. and it runs just fine under XP or
Vista.

However, on my Vista machine, I installed MS Access 2007. Now, my
2003 DB will not open any forms. (Will not run under MS Access 2003.
Not trying to convert up here, just want both versions on the PC, and
(for now) want the code to run as it should under 2003!)

The tables and queries seem OK. The forms are based on a default
query that includes a value (ie first part# in database as in
"11111111" ). This is because I change the forms recordset via code
often, so the default is a simpe query for my use (as the developer)
that lets me open a form in normal view, and see one record.

When I try to open ANY form, (and there are many, all based on
different tables with different keys, etc.) I get a message asking for
a parameter value for the Primary key. Remember, I just told you that
the default query for each form has no parameters. The value is
placed in within quotes in the Qrydef window.

If I click a few times, I get an error message that basically
statesthat I may have a missing refference. However, No ref's are
missing, and the code will still compile. What I DO SEE is a ref to
MS Access 12 Object Library, and the MS Access 11 Object Library is
not in the list to chose from.

So, the short question for now, is this: SHOULD the version 12 Object
library work (backward compatible) with MS Access 2003, or not? And,
if NOT, why is the version 11 Object Library missing after my install?

I have searched on the web, and cannot find anyone complaining of a
similar problem.
I have not opoened the 2003 DB with 2007, all I did was install 2007
(leaving Access 2003 on the machine).

If you can help, fine. if not, just ask and I can send more details.

THANKS!
 
Dan, I haven't struck the specific problem, so if anyone else has, hopefully
they will contribute.

Presumably you have either digially signed the database, or added its folder
to your trusted locations under:
Office Button | Access Options | Trust Center | Trust Center Settings

You must not use the Office 11 library. The Office 12 library should provide
the functionality you need. It is possible that your code uses some
deprecated or removed features such as these:
http://allenbrowne.com/Access2007.html#Compatibility
However, if that were the case, I would not expect the code to compile
(unless you are using something like late binding that prevents the compiler
recognising it.)

So the short answer is, Yes: the Office 12 library should give what you
need. I've converted several database to ACCDB files, and opened many MDBs
under Office 12, and they all worked fine. But mind you, I used only 3
libraries (Access, VBA, and DAO), and I tend to write pretty standard code
so as to avoid future upgrade issues.

The parameter asking for the primary key value is a worry. I could
understand that if the parameter value were not a literal but somehing like:
[Forms].[Form1].[Text0]
because you have a chicken'n'egg issue here.
But it ought not to ask for the parameter if:
- the value is a literal, and
- the field name is spelled correctly, and
- the field name is included in the query, and
- the literal is correctly delimited (without the quotes for a Number type
field), and
- the name is not a reserved word, and
- you have turned off Name AutoCorrect (to prevent Access getting confused
about the name.)

You say the problem occurs when you set the Recordset of a form. I rarely do
this, as I have found it less stable than setting the RecordSource. So I
often open a form without any records e.g.:
SELECT * FROM Table1 WHERE (False);
and then assign the RecordSource based on the user's needs, e.g.:
http://allenbrowne.com/ser-62.html

Not sure that answers you q.; just thinking out loud with you.
 
I think it's some kind of known problem with Vista, and
Office, which goes away if you have full admin privileges
to re-register the objects.

The 11 and 12 object libraries are fully compatible, and
fully replicable. But internally they are different, and use
different files. So if you use 12 and also load the 11 library,
or 11 and also load the 12 type library, your code and forms
compile ok (references to 11 or 12 are identical), but
crash when you try to actually do anything.

(david)
 
Dan, I haven't struck the specific problem, so if anyone else has, hopefully
they will contribute.

Presumably you have either digially signed the database, or added its folder
to your trusted locations under:
Office Button | Access Options | Trust Center | Trust Center Settings

You must not use the Office 11 library. The Office 12 library should provide
the functionality you need. It is possible that your code uses some
deprecated or removed features such as these:
http://allenbrowne.com/Access2007.html#Compatibility
However, if that were the case, I would not expect the code to compile
(unless you are using something like late binding that prevents the compiler
recognising it.)

So the short answer is, Yes: the Office 12 library should give what you
need. I've converted several database to ACCDB files, and opened many MDBs
under Office 12, and they all worked fine. But mind you, I used only 3
libraries (Access, VBA, and DAO), and I tend to write pretty standard code
so as to avoid future upgrade issues.

The parameter asking for the primary key value is a worry. I could
understand that if the parameter value were not a literal but somehing like:
[Forms].[Form1].[Text0]
because you have a chicken'n'egg issue here.
But it ought not to ask for the parameter if:
- the value is a literal, and
- the field name is spelled correctly, and
- the field name is included in the query, and
- the literal is correctly delimited (without the quotes for a Number type
field), and
- the name is not a reserved word, and
- you have turned off Name AutoCorrect (to prevent Access getting confused
about the name.)

You say the problem occurs when you set the Recordset of a form. I rarely do
this, as I have found it less stable than setting the RecordSource. So I
often open a form without any records e.g.:
SELECT * FROM Table1 WHERE (False);
and then assign the RecordSource based on the user's needs, e.g.:
http://allenbrowne.com/ser-62.html

Not sure that answers you q.; just thinking out loud with you.

--
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.




I am a pretty seasoned MS Access Developer, and (at the moment) I
will not go into the details of my code, etc. I'll do that later if
nobody seems familiar with my issue. i have an MS Access 2003 DB with
lots of code, forms, queries, etc. and it runs just fine under XP or
Vista.
However, on my Vista machine, I installed MS Access 2007. Now, my
2003 DB will not open any forms. (Will not run under MS Access 2003.
Not trying to convert up here, just want both versions on the PC, and
(for now) want the code to run as it should under 2003!)
The tables and queries seem OK. The forms are based on a default
query that includes a value (ie first part# in database as in
"11111111" ). This is because I change the forms recordset via code
often, so the default is a simpe query for my use (as the developer)
that lets me open a form in normal view, and see one record.
When I try to open ANY form, (and there are many, all based on
different tables with different keys, etc.) I get a message asking for
a parameter value for the Primary key. Remember, I just told you that
the default query for each form has no parameters. The value is
placed in within quotes in the Qrydef window.
If I click a few times, I get an error message that basically
statesthat I may have a missing refference. However, No ref's are
missing, and the code will still compile. What I DO SEE is a ref to
MS Access 12 Object Library, and the MS Access 11 Object Library is
not in the list to chose from.
So, the short question for now, is this: SHOULD the version 12 Object
library work (backward compatible) with MS Access 2003, or not? And,
if NOT, why is the version 11 Object Library missing after my install?
I have searched on the web, and cannot find anyone complaining of a
similar problem.
I have not opoened the 2003 DB with 2007, all I did was install 2007
(leaving Access 2003 on the machine).
If you can help, fine. if not, just ask and I can send more details.
THANKS!- Hide quoted text -

- Show quoted text -

Allen,
I meant to say RecordSource (I do it the same way you do). I know
NOTHING about the new security features, and hopefully the links in
your post will point me in the right direction. I don't have a lot
of "Play-time" at home to experiment with this, so it will take me a
few days to try all of your suggestions. I use this mdb at work all
of the time, and have many XP boxes available to me, so I' m just
trying to "dip-my-toes" into Vista and office 11 at home.

Most of all, I wanted to tell you how much I APPRECIATE your "Thinking
out Loud" with me, and I will surely try all you have suggested.

THANKS a BUNCH for the thoughts, - I have a starting
point now (as soon as time permits) !

Dan.
 

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

Back
Top