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