473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using a variable to allow opening multiple Access databases

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
3 1625
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
579 512MB
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
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

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

Similar topics

4
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
1
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the...
5
by: Michelle Stone | last post by:
Hi everybody I am writing a simple asp.net application using form authentication. I store the list of all users and their passwords in an SQL Server database table. My client recently told me...
6
by: Alec MacLean | last post by:
Hi, I've created a small application for our company extranet (staff bulletins) that outputs a list of links to PDF's that are stored in a SQL table. The user clicks a link and the PDF is...
14
by: ml_sauls | last post by:
I've built a system to enter and manage purchase orders. This is in use by >10 clients. Some use it in Access 97, most are in A2k. About half use it through a Citrix implementation. It is...
7
by: MLH | last post by:
I use this line DoCmd.SelectObject acTable, "tblAdmin", True when I want to display database window. Often- times, working on a remote mde via a TCP/IP connection, its convenient to have a...
3
by: Suresh P | last post by:
Hi All, I tried to access the mysql database in ODBC using ip address and username/password. It returns, "cannot connect to MySQL server on IP ADDRESS(10060)". This could be related to Firewall...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.