Set a Connection object's .Connectionsource property at run time
I would like to be able to set a connection object's .Connectionsource property
at run time.
At design time I create a connection object in the dataEnvironemt designer.
It is a JET 4.0 OLE provider and this is set on the "provider" tab. I then
set the full path and database name on the "connection" tab. This works fine.
If you hit F4 and view the value in the Connectionsource property, it contains
both the provider and connection info.
I need to set this at run time because when my app gets installed somewhere
else, the database will be in another path.
I store the path to the database in a .ini file that gets read at run time
but when I try setting this property directly in the main module of my app
as well as other places, I allways get an error message. Help !!!
Thanks
Pete
Re: Set a Connection object's .Connectionsource property at run time
What is the error??
Paste your code, so we can see it
Tonny
"Pete Mitchell" <petemitchell@sprint.ca> wrote:
>
>I would like to be able to set a connection object's .Connectionsource property
>at run time.
>
>At design time I create a connection object in the dataEnvironemt designer.
>It is a JET 4.0 OLE provider and this is set on the "provider" tab. I then
>set the full path and database name on the "connection" tab. This works
fine.
>If you hit F4 and view the value in the Connectionsource property, it contains
>both the provider and connection info.
>
>I need to set this at run time because when my app gets installed somewhere
>else, the database will be in another path.
>I store the path to the database in a .ini file that gets read at run time
>but when I try setting this property directly in the main module of my app
>as well as other places, I allways get an error message. Help !!!
>
>Thanks
>
>Pete
>
Re: Set a Connection object's .Connectionsource property at run time
Problem Solved..
I created a connection object in the dataEnvironemt designer.
If you hit F4 and view the value in the
"Connectionsource" property, it contains
both the provider and connection info.
I wanted to set this at run time.
I was getting error messages because I was doing something like:
deDataEnv1.cnConn1.connectionSOURCE = "sting of stuff"
I need to reference the connectionSTRING prop. like this:
deDataEnv1.cnConn1.connectionSTRING = "sting of stuff"
Oh well, I doubt I'll make that mistake again.
Thanks for the response..
Pete