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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can Data Environment connection be changed in code

Status
Not open for further replies.

Toby1kenobe

Instructor
May 26, 2002
66
GB
Hi all

I'm using Data environment to bind my front end to .mdb. I'm concerned that if i use the DE that i wont be able to add a routine that lets the user select a new (or find) data file. Can the Data Environment connection be changed in code?

If so i don't need to worry
Thanks in advance

Toby
[flush2]
 
Yes, I've done this before.

Naturally you must have some connection specified using the Data Environment interface when developing and compiling your app but you can change the connection dynamically by editing the connection string as follows -

DataEnvironment1.Connection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=C:\Database.mdb"

- before you use the Open command.

Brendan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top