ADOC Problem 
Author Message
 ADOC Problem

Running NT4 SP6, VB6 Enterprise SP4, MDAC 2.6, etc.
I will just extract the essentials:
Two Forms; Form1 calls Form2. Form2 has an ADODC Control.
All goes well. No Error msgs, etc. in the Development Environment.
However, after the Project is compiled and installed on another machine, the
EXE throws-up the msg "ADODC1 Could not find the file + {The Path to the
Database in the IDE}" when Form2 is loaded.
This is reasonable because the original Path is no longer available to the
EXE.
Clicking OK then brings up an Error Message when the Error is 'trapped' by
Form2's 'On Error goto etc.'
I can resolve the second Error Message by setting the ADODC ConnectionString
in Form2's Form_Load() and Controls which are bound to the ADODC function
correctly.
However, the first error message is generated somewhere BETWEEN Form1 saying
Load Form2 and Form2's Form_Load Event being fired and I just cannot trap
it!
It would seem that ADO has (thank you very much) done some checking of what
it will be doing for Form2 before Form2 is actually loaded.
Great, but if I cannot trap an error that occurs in this 'ADO WalkAbout', I
cannot respond appropriately to it!
How can I reset the Form2's ADODC's Connection String before asking Form1 to
Load Form2?
I tried (in Form1):

Form2.ADOC1.ConnectionString = {The New Value}
Load Form2

but that didn't work. It did reset the ConnectionString but the 'ADO
WalkAbout' still found the old string!
Any ideas??



Sun, 03 Aug 2003 05:43:34 GMT  
 ADOC Problem
Not that I expect it to make much difference, but did you try
resetting the string in Form2's "Load" event?

When you make that call to reset the string in the ADODC, before loading form2
Form2 gets loaded for you behind the scenes (so you actually load
it twice).  It's possible that the ADODC check is not made until the form is
completely loaded.  If the Load event takes place before the ADODC check, you
may have a prayer.

Quote:

> Running NT4 SP6, VB6 Enterprise SP4, MDAC 2.6, etc.
> I will just extract the essentials:
> Two Forms; Form1 calls Form2. Form2 has an ADODC Control.
> All goes well. No Error msgs, etc. in the Development Environment.
> However, after the Project is compiled and installed on another machine, the
> EXE throws-up the msg "ADODC1 Could not find the file + {The Path to the
> Database in the IDE}" when Form2 is loaded.
> This is reasonable because the original Path is no longer available to the
> EXE.
> Clicking OK then brings up an Error Message when the Error is 'trapped' by
> Form2's 'On Error goto etc.'
> I can resolve the second Error Message by setting the ADODC ConnectionString
> in Form2's Form_Load() and Controls which are bound to the ADODC function
> correctly.
> However, the first error message is generated somewhere BETWEEN Form1 saying
> Load Form2 and Form2's Form_Load Event being fired and I just cannot trap
> it!
> It would seem that ADO has (thank you very much) done some checking of what
> it will be doing for Form2 before Form2 is actually loaded.
> Great, but if I cannot trap an error that occurs in this 'ADO WalkAbout', I
> cannot respond appropriately to it!
> How can I reset the Form2's ADODC's Connection String before asking Form1 to
> Load Form2?
> I tried (in Form1):

> Form2.ADOC1.ConnectionString = {The New Value}
> Load Form2

> but that didn't work. It did reset the ConnectionString but the 'ADO
> WalkAbout' still found the old string!
> Any ideas??



Tue, 05 Aug 2003 08:00:22 GMT  
 ADOC Problem

I have investigated this problem a bit more and have come to more-or-less the same conclusion.
The error message is generated by ADO whilst it is 'preparing' Form2. It cannot be trapped in either Form1 or Form2.
Unless (and this is most unlikely) anyone knows of a way to diable Error Trapping by ADO (temporarily) then the problem cannot be resolved!
A bit of a shame really because being able to use an ADODC does reduce the code one has to write.

*** Sent via Developersdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!



Wed, 06 Aug 2003 05:20:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB6 ADOC control problem !!!

2. Getting error message when using SQL for data source in ADOC

3. Calendar1.value & ADOC

4. Calendar1.value & ADOC

5. Calendar1.value & ADOC

6. ADOC Data cotrol

7. Update ADOC 3.0 -> 3.1 ???

8. problems problems problems

9. Problems, Problems, Problems.....

10. Problem!Problem!Grid Problem!

11. Problems, problems, problems...

12. The 3048-Problem - Please, MS FIX THIS PROBLEM!!!

 

 
Powered by phpBB® Forum Software