VS 2010 connecting to Access 2007 db

Anyone know the code to connect to an Access 2007 db from VB 2010?
Sheldon LivingstonConsultantAsked:
Who is Participating?
 
DhaestCommented:
Example (adjust the connectionstring)
http://www.startvbdotnet.com/ado/msaccess.aspx
0
 
DhaestCommented:
You can find the connectionstring here:

http://connectionstrings.com/access-2007
0
 
Sheldon LivingstonConsultantAuthor Commented:
I'm looking for the complete code needed... diming connection object, etc.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Sheldon LivingstonConsultantAuthor Commented:
Dhaest:  Oops... getting "could not find installable isam" error.
0
 
DhaestCommented:
Are you sure that you changed the connectionstring correctly ? Is access installed on that machine ?
0
 
Sheldon LivingstonConsultantAuthor Commented:
       cn = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;_Data Source=C:\VSL\Estimating\estimating.accdb;Persist Security Info=False")
        'provider to be used when working with access database
        cn.Open()
        cmd = New OleDbCommand("select * from items", cn)
        dr = cmd.ExecuteReader
        While dr.Read()
            '            TextBox1.Text = dr(0)
            '           TextBox2.Text = dr(1)
            '          TextBox3.Text = dr(2)
            ' loading data into TextBoxes by column index
        End While

        dr.Close()
        cn.Close()
0
 
Sheldon LivingstonConsultantAuthor Commented:
What a goof... I left the underscore in front of "Data Source".
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.