General discussion

Locked

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.

Thanks,
Mike Mangel
wxdk@iup.edu

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;" & _
"Pwd=Password"
oODBCConnection = New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()


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

cmd.CommandText = "SELECT * FROM Log"

odr = cmd.ExecuteReader()

odr.Read()

MsgBox(odr("LogID").ToString())

Collapse -

Check this link

by Chekuru.murali In reply to Connecting VB.Net to an A ...
Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums