Full Version: Warning! Compatibility problem between A2002 and A2007
UtterAccess Forums > Microsoftョ Access > Access Forms
Vladimir
There are some indications that some (event) procedures don't fire in Access 2007. We're just testing our application in A2007 which we started to develop in A2002. Some forms didn't pass the tests in A2007 so that I made debug printouts of the same steps (procedures) in the same form. Part of the code runs on Form_Open, another part is in Form_Current. As you can see the code runs in different (sub)forms.

Access 2002
-----------------
toto hledam
toto taky hledam
frmPZ_Denik.RecordSourceselect * from qryPZ_denik where ((DD=TRUE) And (ID_FOkn Is Not Null))
toto hledam
Me.Parent!frmPZ_Denik.Form.RecordSource=select * from qryPZ_denik where ((DD=TRUE) And (ID_FOkn Is Not Null))
toto hledam
Me.Parent!frmPZ_Denik.Form.RecordSource=select * from qryPZ_denik where ((DD=TRUE) And (ID_FOkn Is Not Null))
toto hledam
Me.Parent!frmPZ_Denik.Form.RecordSource=select * from qryPZ_denik where ((DD=TRUE) And (ID_FOkn Is Not Null))
toto hledam
Me.Parent!frmPZ_Denik.Form.RecordSource=select * from qryPZ_denik where ((DD=TRUE) And (ID_FOkn Is Not Null))

Access 2007
-----------------
toto hledam
toto taky hledam
frmPZ_Denik.RecordSource
toto hledam
Me.Parent!frmPZ_Denik.Form.RecordSource=
toto hledam
Me.Parent!frmPZ_Denik.Form.RecordSource=
toto hledam
Me.Parent!frmPZ_Denik.Form.RecordSource=
toto hledam
Me.Parent!frmPZ_Denik.Form.RecordSource=

The form that is performing OK in A2002 doesn't work in A2007.

It seems that Access 2007 is not compatible with Access 2002.
Windows XP CZ SP3
Access 2002 CZ SP3
Access 2007 CZ SP1

I hope I'm doing something wrong... maybe I just need to add fully classified subform names. But I think the same code should perform same way in different versions of Access.

Anyone else have similar indications? Please, let us know as soon as possible.

Thank you very much for your time in advance.
vtd
Where are all the double quotes / single quotes being used as the (SQL) String delimiters???
Vladimir
This is just a debug outprint (copy of Debug window), ie. without double quotes / single quotes.
datAdrenaline
This effect may be do to A2007 running in Sandbox mode. A2007, by default, operates in Sandbox.
For more information on A2007 and Sandbox mode: Click Here
Vladimir
Does that mean that
a) either end user has to edit his/her registry
or
b) my application won't run?

How do I install my application with Developer Extensions MSI? I mean, will the "Additional Registry Keys" do the trick for me?
Vladimir
I have tried all SandBoxMode value (3, 2, 1 and 0) and I still can't get it to work. I may not fully understand the following:
"Remember that if you do not first trust the database, Access disables any unsafe expressions regardless of whether you change this registry setting."

How do I do it with Developer Extensions & PDW (Package Solution)?
Aquadevel
Vladime,
You need to set up the 'trust locations' for the database files first.
otherwise:
"Access disables any unsafe expressions regardless of whether you change this registry setting." ........"
and you still get the issue you are seeing.
Good luck,
sad.gif
Vladimir
Thx for your input, Aquadevel.
) I have added the folder with the application in the trusted folders list, but I still have the same problem.
2) How could I create a MSI-file (Package Solution Wizard) so that all security issues might be solved during installation on the end user's machine?
datAdrenaline
Before we go down that route, it would be great to see your code! .. the debug outputs do not tell us the code you are using ...
Vladimir
I'm about to inspect the code. What I've found so far is a "slight" incompatibility how both A2002 and A2007 create forms'/reports' Filter and OrderBy strings when the user filters data by selection or when he/she sorts form's data:

Filter example:
--------------------

If = myForm.Filter

A2002:
f = "myFormName.myField='231'"
or
f = "myField='231'"
A2007:
f = "[myFormName].[myField]='231'"


OrderBy example:
------------------------

o = myForm.OrderBy

A2002:
o = "myFormName.myField"
or
o = "myField'"
A2007:
o = "[myFormName].[myField]"


Brackets may cause problems in string functions:
f = Replace(f, "myFormName.", "")
A2002: f = "myField='231'"
A2007: f = [myFormName].[myField]='231'

Please note that resulting A2007 string cannot be used in some SQL-expressions. Some applications that were written in previous version of Access, eg. A2002, or some parts of older applications, may fail when run under A2007!!!
datAdrenaline
How do you set you Filter property ... if I manually set the property with a right-click, "Filter by Selection" in A2003 I get ...

((tblAreas.Area = "180L"))

In A2007 ...

([tblAreas].[Area] = "180L")

...

So it is clear that A2007 does it differently ... but... I note that you have single hash mark quotes? ... I don't think Access will do that? .. so do you have code to set the filter?

...

Either way, you can account for this difference by first removing any brackets, then remove your table qualifier.... but ... it would seem that both strings, in there entirety, could be used in a SQL statement .. For example ...

strSQL = "SELECT * FROM SomeTable WHERE " & Me.Filter

... So why do you need to remove the table qualifier?

Edited by: datAdrenaline on Sun Aug 24 10:53:13 EDT 2008.
Vladimir
"I don't think Access will do that?"
You're right, sorry for the typo. This is what I exactly get from form's filter property:
A2002: ((frmMyForm.myField="231"))
A2007: ([frmMyForm].[myField]="231")
There's "parenthesis" difference betwen them , too!!! Oh, oh, ...

"SELECT * FROM SomeTable WHERE " & Me.Filter
like
"SELECT * FROM SomeTable WHERE " & "([frmAreas].[Area] = ""180L"""
It won't work for sure! It's done in a form not a datasheet/table. That's a big difference - I need to remove FORM qualifier instead of table one! Or I'll have a problem with SQL since A2007 will ask a value for an unknown parameter [frmAreas].[Area].

Thank you very much for your response - now I'm sure there's difference between the two Accesses.
datAdrenaline
My experiment was done on a form ... NOT a datasheet .... Form was bound to a table... tblAreas, I right click on a bound control ("Area") ... and I got the table reference in the filter ... HOW are you setting your filter?
Vladimir
In the form: right click on the field and choose Filter by selection from a popup menu. The popup menu was created in a A97 app and then imported to A2002. A2002 popup menu seems to perform OK on a form when tested in A2007.

Finally, I just realised that the difference was on a subform. Oh, me!
This is what I get on A2007 app's subform:
Me.Filter=([frmIDs].[ID]=3)
Me.OrderBy=[frmIDs].[txtTest]

There's form qualifier instead of datasource qualifier in subform's Filter and OrderBy strings. Anyway, there are still the brackets that broke compatibility between A2002 and A2007. It is necessary to remove form/table qualifier in some occasions, eg. if you want to use if for different datasource (query).

P.S. Thank you very much for your patience.
datAdrenaline
>> Thank you very much for your patience. <<
o problem!!! ... Its always good to discover differences in behavior between the versions of Access!
>> The popup menu was created in a A97 app and then imported to A2002. <<
Does the popup menu execute code? ... The reason I ask is simply because even in a sub-form I get the table reference! ... shrug.gif
...
Anyway... to correct this, I think I would write the code to strip the brackets ...
strFilter = Replace(frm.Filter,"]","")
strFilter = Replace(frm.Filter,"[","")
<Then your current code>
This should work, but you may have to deal with the extra parenthesis too! ...
You may even consider using the Split() function to get everthing on the right side of the decimal point, then stripping the parens ...
strFilter = Split(frm.Filter, ".")(1)
strFilter = Replace(frm.Filter, ")","")
....
Obeleive the above would be valid in each version ...
....
Hope that helps!!!
Vladimir
"Does the popup menu execute code?"
Nope! I use original A97/A2002 commandbar buttons.

I have written fncVersionString yesterday so that this partular part of code runs on both A2002 and A2007. BTW, I'd add the following code in your function:
strFilter = Replace(frm.Filter, "(","")
覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧
Could I aks you a favour, please? I'm creating a A2007 database with bugs & issues (to be sent to MS tech-support as soon as possible), see the attachment. It is possible to test the "parenthesis/brackets/qualifiers" incompatibility:
1) Run the project in A2007.
2) Search for ID 4 (the 3rd record).
3) Click the "Test (see ID ..)" field in the "Also see" subform (to the rigt top of "Description").
4) Apply sort by the filed.
5) In the subform Go to the record with "Alse see" (ID) = 28 and apply filter (equals 28).
6) Double-click the "Also see" label in the subform and you'll get the message box.

The string here, on my machine, is:
Me.Filter=([frmIDs].[ID]=28)
Me.OrderBy=[frmIDs].[txtTest]

You can find the string in the Debug window, too. Pls, let me know if you get anything else.

Thank you very much for your help.

P.S. There's still a lot to test in the attached database so don't take too seriously yet. I have removed all attachments so that it ZIPs under 500000B UtterAccess limit. ;-)
datAdrenaline
I will take a look at it tonight or tommorrow ... I have been very busy at home lately and I do not have A2007 at work to check on it during my lunch or breaks .... so ... I will let you know as soon as I can!..
lso ...
>> strFilter = Replace(frm.Filter, "(","") <<
The reason I did not add that is simply because with the split(), and from what I know of your config, I didn't think that would be needed ...
Me.Filter=([frmIDs].[ID]=28)
strFilter = Split(Me.Filter,".")(1)
'strFilter now equals "[ID]=28)"
strFilter = Replace(frm.Filter, ")","")
'strFitler now equals "[ID]=28"
....
If you need to strip the left paren, then by all means do so .... my main purpose was to hint to "clean" the respective strings to make them universally manipulatable!! ... sad.gif ...
....
Looking forward to examining your db .... thumbup.gif
Vladimir
Thank you very much in advance. notworthy.gif
datAdrenaline
Hey Vlado ...
Ylado ...
Your db did not run ... the code won't compile ... so .. I can't even open the start-up form.
Vladimir
I can't believe what you're saying! Can you download full version (with all attachments) from http://www.volny.cz/cvajniga/Access2007_bugs-001.zip?? (approx. 4.4 MB)

TIA
Vladimir
It must have been a problem in my sight. I've removed some code from a corrupted form example.
New version of database is available at http://cvajniga.707.cz/Access2007_bugs.rar (~14MB). I'd appreciate your help if you have any chance to DL the database.
Thank you very much in advance.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.