General discussion


Connecting VB.Net to an Access Database

By wxdk ·
If someone could please send me code that I can use to connect an Access Database in VB.Net. I would greatly appreciate it. I need to be able to add delete and update from a form.

Mike Mangel

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Comments

Collapse -

Try using imports System.Data.ODBC

by aaroncool In reply to Connecting VB.Net to an A ...

Dim oODBCConnection As OdbcConnection
Dim sConnString As String = _
"Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=C:\Test.mdb;" & _
oODBCConnection = New Odbc.OdbcConnection(sConnString)

Dim odr As OdbcDataReader
Dim cmd As New OdbcCommand()
cmd.Connection = oODBCConnection

cmd.CommandText = "SELECT * FROM Log"

odr = cmd.ExecuteReader()



Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums