How to data stuff from an Access Database with VB 2005

I see other solutions, but have been beating my head trying to get set up to be able to port my vb6 stuff to .net. I use an Access Database with Many tables and relationships. Most of all the samples I see are for SqlServer etc. Where is a good area to go find samples etc for doing Access with VB2005?
[302 byte] By [LarryGatlin] at [2008-2-13]
# 1
Hi,
Accessing SQLServer is much more the same as Access...
Just use the OleDb namespace instead of the SqlClient...
eg...

use OleDbConnection rather than SqlConnection...
here's a sample to get you started (In C# though):
OleDbConnection myConn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source=C:\\myTest.mdb");
myConn.Open();

OleDbDataAdapter adapter= new OleDbDataAdapter("SELECT * FROM Table1", myConn);
DataSet ds = new DataSet();
adapter.Fill(ds, "Table1");
// Access the table From here...
cheers,
Paul June A. Domag

PaulDomag at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
Thanks a lot. Started getting more Ideas as I swim through the Documents.
LarryGatlin at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
Hi Larry -

Here's a couple topics on connecting to an Access database:

http://msdn2.microsoft.com/library/cf131f6b(en-us,vs.80).aspx

http://msdn2.microsoft.com/library/ms171893(en-us,vs.80).aspx
After you establish your connection you can check out this section of topics that show how to display the data on a Windows Form:
http://msdn2.microsoft.com/library/ms171923(en-us,vs.80).aspx

Hope that helps...

SteveS_MS at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
Hi Larry,

I think Steve's response and resources will help.

Note also that we're looking into beefing up our samples here over the next few months.

thanks,
Paul

PaulYuk_MS at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 5
Thanks a lot for the help. I've been doing VB6 all this time and now want to learn the .net world, as I can see where things are going!!!

I will go through the infomation and LEARN! I really like the Samples but could even use more that actually use real world situations. There are no plans in the future right now to migrate to SQL, so must be able to continue to use the Access Database.

Larry Gatlin

LarryGatlin at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 6
As an added information. I have always connected and did the database stuff in code, I never used the Data Environment in VB6. My programs/Applications I am working with require constant updates to various tables as there are multiple users. There are Fields that are unique and can not have dups. \

I've been trying the dataset and datatables etc, but get kinda lost. I just found out this morning that if you have a Combo box set for sorted, the databinding don't work. I do not do databinding in my vb6/ADO applications, but have dappeled a little trying to learn. That is how I have learned is trying and working with the infomation. That is why I am glad to see Edit and Continue return to VB.

Again thanks for the leads, I will follow them.

Larry Gatlin

LarryGatlin at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...