Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connecting to an Access Table
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01059787
Message ID:
01059794
Views:
10
That'll wurk.

I know very little about Access. (Who uses Access?) How do I know where
Access keeps it's tables/DB's?



>I need to connect to an Access table using VB.Net and then run a query
>and return the results.
>
>Can someone provide an example?

>
>Hi, Kevin,
>
>How about this?
>
>
>Imports System.Data.OleDb
>
>Dim cn As OleDbConnection
>Dim cmd As OleDbCommand
>Dim dr As OleDbDataReader
>
>cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\emp.mdb;")
>cn.Open()
>cmd = New OleDbCommand("select * from table1", cn)
>dr = cmd.ExecuteReader
>While dr.Read()
>   ' do something with the datareader  TextBox2.Text = dr(1)
>End While
>
>
>If you google on "VB.NET" and "MSACCESS" (or other keywords), you're likely to find many examples.
>
>Hope that helps....
>Kevin
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform