Discussion Locked
0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is it possible to set the connectionstring property of an ADO data control at runtime? I am writing an app and want to be able to allow the user to specify the where the database is stored on the hard drive. So the connectionstring property must be set at runtime as I read it in from a .ini file. Any ideas?
4 replies
Yes, the ConnectionString property can be set at runtime. What problem are you having getting it set?
by ggardner
On form load I run
datPrimaryRS.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & DB_Path & "sei.mdb;"--DB_Path holds the path to the database (and it is correct at runtime).
This changes the connection string alright, but the data from the new database doesn't show up on the form. The form continues to show the data from the database specified in the connectionstring property during development.
Do I need to do something to refresh the recordset or something?
by ggardner
I figured it out! I have to set the recordsource again then do a refresh on the data control. If this is not right or there is a better way, let me know. Thanks.
by ggardner
This question was closed by the author
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending
0 helpful
5 replies
1 helpful
3 replies
0 helpful
1 reply
0 helpful
1 reply
Question Unanswered
PDF vs HTML
0 helpful
0 replies