converting 2.0 to 97

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get compile errors in the code when converting my 2.0 into Access 97. Is there any way- short of a programmer- to convert the code? Any software? I get various errors about not recognizing types of code.
 
Access 2.0 used Access Basic as it's programming language. With the move to
Access 97, it was changed to Visual Basic. The two are similar, but have
some differences. The Compatibility Library that is installed during the
conversion acts as a bridge for some of these, but not all. The only thing
to do is to modify the programming to match the VB way.

Here are some common problems:
Simple coding errors you can correct:

1. One of the most common errors at compile time involves the "DoCmd"
statement. In Access 2.0, it was used like this:
DoCmd Maximize
DoCmd DoMenuItem A_FORMBAR, A_EDITMENU, A_SELECTRECORD
DoCmd OpenTable "Orders", A_NORMAL

these can be corrected by placing a dot (.) between DoCmd and the next word
without any spaces, so they would be:

DoCmd.Maximize
DoCmd.DoMenuItem A_FORMBAR, A_EDITMENU, A_SELECTRECORD
DoCmd.OpenTable "Orders", A_NORMAL



These errors are common, because many of the wizards create code with DoCmd,
and of course, the Access 2.0 wizards created them the 2.0 way. So even if
you don't think you have code to convert, if you used wizards to make
buttons, combo boxes, list boxes, etc., you do. Since the conversion
process does not touch code, you will have to.



2. Access 97 will often issue an error message during execution (i.e.
when you run your program) if you have incorrectly mixed up the use of bang
(!) and dot (.). The conversion will not catch this. Access 2.0 generally
allowed interchange of (!) and (.) where it was interpretable.

3. Access 97 seems much more likely to cause an execution error when
you use a reserved word in an illegal manner (such as for a name of a
control or table column--without brackets). For instance, a common problem
is to name a field "Date". Since "date" is a reserved word, this may cause
a problem in a query if you don't use square brackets [] around it when it
is used in the criteria. A better solution is to rename it EVERYWHERE as
"StartDate" or something else which is applicable.


--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org


R Smock said:
I get compile errors in the code when converting my 2.0 into Access 97.
Is there any way- short of a programmer- to convert the code? Any software?
I get various errors about not recognizing types of code.
 
Back
Top