• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

VS 2010 connecting to Access 2007 db

Anyone know the code to connect to an Access 2007 db from VB 2010?
0
classnet
Asked:
classnet
  • 4
  • 3
1 Solution
 
DhaestCommented:
You can find the connectionstring here:

http://connectionstrings.com/access-2007
0
 
classnetAuthor Commented:
I'm looking for the complete code needed... diming connection object, etc.
0
 
DhaestCommented:
Example (adjust the connectionstring)
http://www.startvbdotnet.com/ado/msaccess.aspx
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
classnetAuthor 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
 
classnetAuthor 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
 
classnetAuthor Commented:
What a goof... I left the underscore in front of "Data Source".
0

Featured Post

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.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now