Numerous Compile Errors Trying to Make MDE

C

Chad

We are in the middle of trying to convert an Access 2003 front end to
talk to an SQL server. Our front end has 100+ forms for which we've
spent about 160 hours changing code and syntax to deal with the
differences between an Access back end and SQL back end. This front
end was previously in Access 2000 format.

The problem is that we've now spent about 120 hours trying to work
through compile errors, mostly relating to recordset statements, I'm
told. The odd thing is that the program works in MDB form without any
perceivable errors.

Is there any way to see how many errors we have left before this thing
will compile? Everyday we feel like we've fixed so much that we must
be almost there. That was 10 days ago :-(

Is there any method to the sequence at which Access tries to compile
code? Does it go through the forms alphabetically? If there was,
perhaps I could at least get a sense of how many forms are left.

I should also note that our front end file keeps growing in size with
each successful attempt to convert to an MDE file. This seems
strange.

Thanks in advance for any much needed help!
 
V

Van T. Dinh

I think Access compiles the current Module first and then follows the orders
that the Modules (Class & Standard Modules) were created.

The important part is to ensure that there is a PrimaryKey as well as the a
TimeStamp Field in each SQL Table that are linked to Access.

In code for (DAO?) Recordsets, you will most likely need to add the
dbSeeChanges option when you create the Recordsets.

Tony Toews has an excellent article on upsizing at:

http://www.granite.ab.ca/access/sqlserverupsizing.htm
 
A

Albert D. Kallal

Chad said:
We are in the middle of trying to convert an Access 2003 front end to
talk to an SQL server. Our front end has 100+ forms for which we've
spent about 160 hours changing code and syntax to deal with the
differences between an Access back end and SQL back end. This front
end was previously in Access 2000 format.

I would assume you stared out with an application that compiles ok..right?

I can't imagine you would start spending money and developer time to upsize
the data to sql server, but not fist fixed any compile errors in the
existing mdb file. In other words, you have a broken application, and you
are now moving trying to get this broken application to work with sql
server. I mean, most development systems do NOT let you run things with
broken code..but it can be very helpful, or your case, this ability sounds
like ms-access has given you too rope here.

The general approach to developing is when you make a small change to your
code, you then compile it..right? Surly, you did not willy nilly go all over
the place changing code, and then trying to compile later on? That makes no
sense at all. Further, some code obviously calls and uses other code. If
other code can't be compiled, then your current routine you are working on
can't get, nor have proper syntax checking either. So, if one routine calls
another, and the parameters don't match, then you get a compile error.
However, if the other routine can't compile, then this parameter and syntax
checking cannot occur (this would be impossible to resolve). So, compile
order is likely in order of dependences.

And, it should be noted that you don't have to make a mde file to compile
here.

Further, the mere fact of linking the tables to sql server should NOT cause
any compile errors at all. In other words, the instant you linked all your
tables to sql server, your mdb file should still have compiled .

I am sure during the normal devilment process you compile frequently and
often...right? In fact, I compile every time I modify some code in a form.
All you do it hit alt-d, and this highlights the debug menu (hey, by the
way, does not the debug menu have a good name in this case!!!). The first
option in this menu is "compile", and thus I just whack enter. In fact,
alt-d, Enter key happens so fast and often, I don't even think about his any
more.

So, often, I go alt-d, hit enter key...product compiles. If I just made a
type-o, then the compiler shows me the mistake. FURTHER, my cursor is put on
the mistake I just made. If no compile errors, then I whack the alt-f4 key
to close down the VB ide. Now, I am right back to my form code, at this
point, I go ctrl-f4 to close the form (you can see, I don't like Mr. Mouse
very much!!). After ctrl-f4, my cursor is usually sitting on the form I was
working on..and so then I hit enter key run and test the form.
The problem is that we've now spent about 120 hours trying to work
through compile errors, mostly relating to recordset statements, I'm
told.

Hum, the above sounds strange. It is not clear if you hint that errors
occurred as result of trying to convert to sql server, or in fact those
errors already existed?
The odd thing is that the program works in MDB form without any
perceivable errors.

Golly, you can have tons of compile errors, and if you run parts of the
system that don't run that bad code, then sure, the application will seem to
run. Really, a good sound developer process here is to never allow a mdb
into production (I never do). I mean, how will you know the syntax is
correct until you try can run the code? It stands to reason that you want to
compile frequently, and this occurs a LONG LONG time before you every get to
making a mde.

Now, you can't fix what is done here. However, lets just say it is very bad
to start a migration to sql server without first making sure the application
compiles. Hence, I would have got the old "non" sql server version working,
and got rid of all compile errors at that point.

As I mentioned, if you take a perfectly working mdb , and it compiles file.
You then upsize and move all the tables to sql server, and then LINK all of
the tables. At this point, the code will COMPILE in this case! It should
NOT break. .

Ok, so, someone messed up. If this was only a day into this, then I would
suggest going back to the original non sql server mdb, and getting that
working correctly, and removing all compile problems. It is a BAD IDEA to
both try and upgrade to sql server, fix things that will need to be changed,
and on top of that try and fix compile errors that EXISTED there from
before!!

And, as mentioned, after moving the data to sql server, NO NEW compile
errors should occur here. Sure, some code will be need to be changed (about
95% or MORE of the code will actually run as is, and NOT have to be changed.
Thus, the code will compile, but in fact NOT work as you need).
I should also note that our front end file keeps growing in size with
each successful attempt to convert to an MDE file. This seems
strange.

Well, hum, during the development process, the front end does bloat and
expand a lot. I didn't know that converting to mde (and failing) would cause
this..but then again, you don't need to convert to a mde to compile here.
Sure, the final step before you release to your users is making a mde, but
as a developer..you simply use the debug menu..and compile. So, you can (and
should) frequently compile from the VB ide. If there is a error in the
current routine you are working on, then that is first error you will get.
After that, I really don't know the sequence. I suspect routines that are
dependent on the current routine, or routines that call the routine you just
modified need to be compiled (since, as I mentioned, correct syntax in the
routine you currently are can depend on other routines that you write).

I would simply open up the first code module (non form), and then go
debug-compile. Any errors you get in that module can be fixed. Now, go to
the next module (I have about 20 modules in my last project). Once you get
all modules compile. Then, I would open up the first form in design mode,
whack the code button, and then again in the IDE go debug-compile. Any
errors in the current module world be shown first. So, at least this gives
you good attack plan here. So, errors in the form you are working on should
show first.
 
C

Chad

First of all, thanks for your detailed response.

Yes, it did compile ok previously and we were successfully able to
create an MDE in Access 2000 format. One of our initial theories was
that Access 2003 (which we recently upgraded to) has a much more
strict compile process than 2000. There was code that he said was
technically right, and did work, that just wouldn't compile in Access
2003.

He thought that Access 2003 would skip sections that previously
compiled ok in Access 2000, but would now try to compile sections that
were modified while we made adjustments for SQL server compatibility.
I think we disproved that theory by making some insignificant changes
to some pre conversion backup code, removing those change, saving and
compiling without error.

So if I understand you correctly, we could really be going in circles?
Potentially he could fix one reference and in doing that break
another one? There is no way to do a "Find Next" type of thing and
run through all the compile errors just to see how many you have left?

Thanks again.
 
A

Albert D. Kallal

First of all, thanks for your detailed response.

You are most welcome. It sounds like you got a battle to win here.!

Yes, it did compile ok previously and we were successfully able to
create an MDE in Access 2000 format

Ok, I kind thought you would have worked from a good starting point, and the
above show this. I in no way wanted to sound harsh here. My approach is
usually to try and go back to a point where things worked!!
One of our initial theories was
that Access 2003 (which we recently upgraded to) has a much more
strict compile process than 2000. There was code that he said was
technically right, and did work, that just wouldn't compile in Access
2003.

Gee, I would loved to see what that one line of code was that did not
compile?

I wonder if the above is/was likely a reference problem? Perhaps the dao and
ado in the references were at issue here? Access 2003 is VERY compatible
with a2000. In fact, they share the same compiler. Further, by default,
a2003 uses the a2000 format. So, you don't actually have to convert the
application to a2003 to edit, and compile code. However, to make a mde file,
then yes...you have to convert up to the same version of ms-access. And,
since we all distribute mde's to the users, then I guess you kind have to
upgrade. (also, this is *very* important, you DO NOT allow multiple users
into this front end at the same time...right? That mde that gets created is
installed on each users pc).

Anyway, since you could make a mde with the a2000 file, then you should have
been able to convert it to a2003, and little, if any errors should have
occurred here. The developer mentioned some syntax...but out of the
conversion, there only have been a line or two of code. Sounds to me like a
broken reference is at issue here. I not aware of any syntax differences
between the two, and thus no compile errors should have occurred. (there was
one post about a forms reference, but was VERY minor). And, further, when
coming from access 97, there are differences because access 97 uses vb5, and
access 2000 and access 2003 use the SAME VB6. (so, they again are VERY
close).
He thought that Access 2003 would skip sections that previously
compiled ok in Access 2000, but would now try to compile sections that
were modified while we made adjustments for SQL server compatibility.

Yes, and that was not a good assumption here. However, the real problem here
is that I don't agree or buy into that some code would not compile due to
syntax. There has got to be a reference problem here. (so, I agree that some
code may not wanted to compile in a2003, but the reasons for this was not
syntax, but a broken reference to some code library --- this could be fixed
by a quick look at the tools->references). In other words, fixing the
references would thus fix all the code (no editing of code would be needed
here).

Also, as mentioned, if you start writing some code,and try and compile
it...the place you are working on generally does compile first. However, if
compile errors exist throughout, then even inti-sense (the auto syntax
complete) does not work. So when I am working, and the auto syntax stuff is
not working, then right away I know something is wrong, and will compile at
that point.
So if I understand you correctly, we could really be going in circles?
Potentially he could fix one reference and in doing that break
another one?

Lets be careful here:
The above term "references" I refereed to is in respect to the
tools->references option from the VB IDE. This is separate and important
issue.

However, yes..if you are talking about changing some code (and not
tools->references), then, yes, it is possible that modifying code can create
more errors. For example, lets assume you change the number of parameters to
sub routine from 2, to 3. Now, if there is 30 places that call the sub
routine, those 30 places now only have 2 parameters being passed, but now
the routine has 3. At this point, those 30 places will generate a compile
error, and you will have to fix those 30 places in your code.

The free www.mztools.com is a great (and free) solution to finding code that
CALLS the current sub you are in. Super those mztools are.

There is no way to do a "Find Next" type of thing and
run through all the compile errors just to see how many you have left?

Hum, gee, I don't think so. However, I will stress that if the a2000
compiled ok, then there is NO reason why it don't compile in a2003. It has
got to be a simple broken reference problem here. Right after converting to
a2003, I would open the vb IDE, and check the tools->references to see what
is missing, or don't belong.

You need to check the references setting. Here is some reading...and it
applies to most ms-access versions:

Allen Browne
http://users.bigpond.net.au/abrowne1/ser-38.html

Doug Steele:
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html

Peter Walker:
http://www.papwalker.com/dllhell/index-page2.html


ACC2000: How to Resolve Reference Issues in an Access Database
http://support.microsoft.com/default.aspx?scid=kb;en-us;310803
 
S

SKumiega

I was also having some MDE errors when I happen accross this thread,
figured out my VB errors by going to
"Debug->Compile..."
but my question is about you one comment:
And, since we all distribute mde's to the users, then I guess you kin
have to upgrade. (also, this is *very* important, you DO NOT allo
multiple users into this front end at the same time..right? That md
that gets created is installed on each users pc).

I haven't used MDE's in the past but recently I've been doing jus
that, split the Databse into BE/FE then compile the FE into a MDE the
just post the MDE to the server and create shortcuts to it on everyone
desktop, could you please tell me why multiple users into a MDE is ba
and what the best option is. :what

Thanks in advance,
Stev


-
SKumieg
 
D

Douglas J. Steele

Shared front ends are far more prone to corruption.

The recommended approach is to give each user his/her own copy of the hard
drive, preferably on their hard drive.

If you're concerned about ensuring that each user has the correct version of
the front-end, check out the free Auto FE Updater Tony Toews has at
http://www.granite.ab.ca/access/autofe.htm
 
Top