[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Single VB.Net app using multiple Access mdb files in windows app

Posted on 2010-08-26
7
Medium Priority
?
733 Views
Last Modified: 2012-05-10
Hi Experts,
I am rewriting my current vb6 application using vb.net (vs 2008) with access database. Current app allows only one .mdb  at a time.  The new requirement is to allow users to open more than one account (each an .mdb files with multiple tables). Copy, move information from one to the other. It would be like Microsoft Word document where you can open multiple documents and view side by side and be able to drag and drop info from one to the other. I have no idea where to begin and how to use multiple connection strings (?), how to keep track of which database is user working with and so on.  I will greatly appreciate any guidance.
0
Comment
Question by:RekhaShah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 20

Expert Comment

by:ElrondCT
ID: 33538734
Multiple connections is no big deal. You simply need to have a separate OleDbConnection for each database that you want to open. What I do is make the non-changing parts of the connection string into constants, then simply tack the name of the particular database I want to open into the middle of it to create the actual connection string used:

    Public Const strConn1 As String = "Data Source="""
    Public Const strConnRW As String = """;Password=;Provider=""Microsoft.Jet.OLEDB.4.0"";" _
         & "Mode=Share Deny None;User ID=Admin;Jet OLEDB:Engine Type=5;"

    oledbconn.ConnectionString = strConn1 & strFullFile & strConnRead

You can use the same construction for any number of connections.

Drag and drop between tables is something I have no experience with, so I can't help you there.
0
 
LVL 13

Expert Comment

by:Lucas
ID: 33538768
This sounds like an interesting project.

The first thing you would have to do is setup a connections database.

LET me know if you need more help
0
 

Author Comment

by:RekhaShah
ID: 33542079
mple code will be great.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:RekhaShah
ID: 33542212
Sorry, I don't know what happenned - most part of my comment disappeared. Here we go again.
Actually, my VB6 app opens two different databases - one for the job and one with the system options. So opening the multiple databse is not the problem.  I have an array of connection strings and I build dynamically by only changing the .mdb path and name part of the string like  ElrondCN suggested.
My confusion is how do I  keep track of the databases. For example, I have one Account1.mdb open. User can edit, delete, add data to multiple tables of this mdb thru multiple winforms. Say, user opens FormJobInfo for Account1.mdb. Now user opens Account2.mdb and opens the same FormJobInfo , only, this time it is populated with Account2.mdb info. Now two instances of the FormJobInfo are displayed sidebyside and user can copy/move data between the two forms.
First, is it doable? if it is, how? It is like running two instances of my current app in a bigger container, if you will.
I think, some OO approach will be helpful in this design. Some sample code will be will great!
0
 

Author Comment

by:RekhaShah
ID: 33573041
I can open two databases using arrays of connection strings and open two instances of the same for with different data.
 But, I want this form to behave like mdi container for its multiple child forms. I know windows does not allow nested MDIs. I am looking for some ideas so that I can have that functionality.
I am sure some one out there must have done similar project! Any idea?
0
 

Accepted Solution

by:
RekhaShah earned 0 total points
ID: 33577884
I think I will close this question and post as a different question.
0
 
LVL 20

Expert Comment

by:ElrondCT
ID: 33578225
I'm sorry I couldn't help further. Good luck.
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question