|
-
May 7th, 2011, 02:25 PM
#1
Load or Connect to DB Dialog VB 2010
Does anyone know if you can create a dialog on the vb form to connect to a ms access 2007 db locally?
I am creating a app to analyze databases for duplicate data for multiple projects. For example, I might have 10 different access databases to analyze individually and I would like to choose them from a dialog control if possible. After the connection is made I will then proceed to run the query from the button click event and spit out the resulting data into a separate winform.
I am not sure if a openfiledialog could be used but any direction to tutorials, etc. would help.
-
May 7th, 2011, 07:11 PM
#2
Re: Load or Connect to DB Dialog VB 2010
You can use a FILEDIALOG to choose the table to use, but there isn't an easy way to open a connection to each table, or even run a query. You can use Access to do that, though
-
May 7th, 2011, 07:51 PM
#3
Re: Load or Connect to DB Dialog VB 2010
Openfiledialog should work fine. You just need to get the filename from the dialog and modify your connection string accordingly with the selected filename then open the db as usual.
Been a while since I tried to check out the structure of a mdb via vb but if memory serves there used to be a way to access the collection of tables in the db and you could retrieve the names and other properties of the tables.
Always use [code][/code] tags when posting code.
-
May 7th, 2011, 08:38 PM
#4
Re: Load or Connect to DB Dialog VB 2010
-
May 7th, 2011, 11:23 PM
#5
Re: Load or Connect to DB Dialog VB 2010
 Originally Posted by dglienna
LINQ to SQL should work
To browse to an Access database?
I was refering to the old DAO methods before, not sure if any of those carried over into ADO or ADO.Net Some of the DAO features were very useful like the seek function on the table object for example was extremely fast once the table had been loaded.
Sounds like the OP just needs to change the active database and if so a file dialog is all that is needed.
Always use [code][/code] tags when posting code.
-
May 9th, 2011, 01:37 AM
#6
Re: Load or Connect to DB Dialog VB 2010
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|