-
S.O.S.
Please help me. I am creating a program in VB 5.0 and am letting the user pick a access database with the commondialog control. I am using the data control to access my database. Can anyone give me some code I can add to let the user pick a database?
Thanks
-VbMichael
-
You can use the common dialog control to actually 'pick' the .mdb file. Once you have the path name to the file, assign the database to your db variable (or to your data control) and you should be in business.
Bash
-
I've tried entering the path directly into the data control. I may have forgoten to type this before but my msflexgrid that I am useing to show the user the contence is still blank after I try to directly enter the path into the data control. I've also tried putting an SQL statment in the recordsource proporty to serch for all fields and still nothing shows up.
-
The way I have done this is to connect the data control via a connection string. Build the connection string (with the file chosen from the common dialog) and then write it to the data control. Do a .refresh and all should be hunky dory.