ADO Data Control = changing ConnectionString at runtime
- From: "Jim Walsh" <JnospamWALSH@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 20 Nov 2006 18:38:38 -0500
I am using the ADO Data Control in a dialog box in an MFC-based application
that I am developing using VS2005.
This application allows the user to select the database at run-time from a
list of available databases whose structure is the same as the one that I
used in developing the application.
My problem: during development, I must set the ConnectionString property of
the ADO control to my master copy of the database on my development
computer. It is my understanding that I will be able to modify that from
within my program at run-time. My class that controls the dialog box
includes a Cadodc member variable. I plan to use the SetConnectionstring()
function of that member to change the connection string of the ADO control
at run-time.
However, when the program runs, and the user brings up that dialog box, I
receive an error from that ADO control saying that it has an invalid path.
This occurs during the Windows creation of the dialog window, and before my
Cadodc control variable has had a chance to get connected with the control,
and thus before I have had a chance to change the connection string.
I have tried setting the ADO Disabled property true at design time, but I
still get the error when the dialog box is being created at run-time.
I would appreciate any help in solving this problem.
Thanks,
Jim
.
- Follow-Ups:
- Re: ADO Data Control = changing ConnectionString at runtime
- From: Mark McGinty
- Re: ADO Data Control = changing ConnectionString at runtime
- Prev by Date: Re: VBA ADO Connection to Oracle with Async
- Next by Date: Re: lengthy operation
- Previous by thread: VBA ADO Connection to Oracle with Async
- Next by thread: Re: ADO Data Control = changing ConnectionString at runtime
- Index(es):
Relevant Pages
|
|