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

Connect Data Environment to Passwrd Protected Database during Runtime

Status
Not open for further replies.

bitterpumpkins

Programmer
Jun 20, 2002
3
MY
HI
i'm having problem wif connecting data environment during runtime to password protected database. I have entered the password during the design time for the data environment and it connects well. However, when i close that particular connection(during run time), and using the same statement (as i used when i first run the system), connect again, the system generates the msg "invalid password". If the database isnt protected with password, everything works ok.

the statement im now using is;
myDataEnv.myConn.Open App.Path + "\database\myDatabase.mdb

i'm wondering if there is any additional parameter needed for the password (for this second time), and if so, how is the command like? sumbody pls help? thx a lot!
 
Have a look at the connection string visible in the old style properties box when you click on the connection icon with the password set and again with it not set. There is a reference to a password in this string. You should be able to change it in code. Also I think maybe you can use Execute to substitute a new string?
 
thank you for ur reply, tedsmith, but can u be more specific? i tried inserting password to my connection string but i still get either 'invalid password' or 'Cant start your application.The workgroup information file is missing or opened exclusively by another user' Execute statement can't be used if the connection is not yet opened.
thank you so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top