By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,097 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,097 IT Pros & Developers. It's quick & easy.

Using a variable to allow opening multiple Access databases

P: 3
Hi, this is my first time posting a question so please bear with me. I am a novice at VB2005 and looking for help utilizing a variable to call open a database. This will allow me to chose which access database (with similar tables) I want to open utilizing the same form. I currently do this in VB6. I can open multiple instances of the same or different databases as an mdichild inside a parent form. I have not found out how to do this in 2005. Any help is appreciated. Thanks.
Apr 2 '07 #1
Share this Question
Share on Google+
3 Replies


P: 3
Just thought I would provide some more information. The line of code that I am trying to modify is shown below

connectionString="Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source="C:\books.mdb""

What I would like to do is replace the MS Acess file name (or name and path) with a variable such as "textbox1.text" or the "OpenFileDialog.FileName" but I can't get it to read the actual text contained in those string variables. If I am mis-using terms, please forgive me as I have not been formally trained in VB.
Apr 3 '07 #2

vijaydiwakar
100+
P: 579
Just thought I would provide some more information. The line of code that I am trying to modify is shown below

connectionString="Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source="C:\books.mdb""

What I would like to do is replace the MS Acess file name (or name and path) with a variable such as "textbox1.text" or the "OpenFileDialog.FileName" but I can't get it to read the actual text contained in those string variables. If I am mis-using terms, please forgive me as I have not been formally trained in VB.
No don't do like that
before opening new form u've to make the main form as mdi parent then make new instance of new form and set its mdiparent=me and then show it
Try it
Good Luck
Apr 3 '07 #3

P: 3
No don't do like that
before opening new form u've to make the main form as mdi parent then make new instance of new form and set its mdiparent=me and then show it
Try it
Good Luck

I have already worked out the parent child relationship and I can open up multible instances of the child form referencing the same database. What I need help with is opening one instance with book1.mdb as the data source and another instance with book 2.mdb as the data source. Both would have the same titles such as author, publish date, etc...
Apr 3 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.