Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Defining connectionstring in adodc when the aplication starts up.

Status
Not open for further replies.

sebpas

IS-IT--Management
Mar 30, 2001
39
0
0
CA
I've looked at all the other posts concerning adodc and could not find an answer to my question.
I'm trying to give the adodc on my application form its connectionstring depending on a registry value that contains the path of the mdb file. Every time I refer to my adodc thru code, it tries to open it with the settings set in the property box at design time. It just doesn't care what you're trying to say to it !!
So, does anyone know how to give an adodc it's connectionstring via code without having a valid one written in the property box (or an empty string in the property box)???
 
I dont know anything but why not use command buttons and not an adodc. Then you can set the connection string when you want to
Remember im normally asking the questions
 
I don't see how a command button would help me, I want the program to open directly on the recordsets of the mdb. Further more, I want ot use the navigation tools on the adodc bar. Everything works perfectly if I put a static path in the property box, but I want this path to be dynamic... If there's no way for me to do this then Microsoft really screwed with this control...

Thanks for replying, any suggestion is welcome.
 
I had a problem with a different control recently. I set values in the activate event and once the control was displayed my values reverted to those from the design. There was another event for the control's object, shown. I moved my settings to that function and they stuck.

Where do you get and use the registry value?



Wil Mead
wmead@optonline.net

 
I use getsetting to retrieve a path that I wrote in the reg at installation. Now I want to use this path to create my connectionstring. The main form appears loaded with the recordset. I'm thinking of using ODBC instead and creating a new dsn via the installer that would contain the path. Do you think it's a good idea?
 
I found the code to create a system dsn for an access database, tried it and works great !! I'll go with this solution instead but there's one thing that I don't like: You can see the mdb password in the registry !!! Guess I'll have to live with it. Still, if anyone finds out how to configure the connectionstring dynamically, let me know..

Sebastien Dupuis
sebasd@fenplast.com
 
Use UDl instead of keeping path in registry. In ADODC
set ConnectionString="File Name=YourUDL.udl".So You point
ADODC only to UDL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top