Acces???

Duckjibe

Member
Joined
Sep 10, 2002
Messages
15
Hey started with vb.net this morning Looks like advancet one:-)... First problem is how to connect to a simple accesdatabase?? Or is it that they dont support access bases any longer...??

Thanks
 
Yep its supported through OleDB. This should get you started. There are also plenty of tutorials on the net for this too. The only difficult hurlde to get over is no more recordsets. So you might want to read up on ADO.NET and datasets/datareaders/etc.

Code:
Dim cn As New OleDb.OleDbConnection()
        cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= c:\some\path\to\data.mdb"
        cn.Open()
        Dim sql As String
        sql = "select * from df_topics"
        Dim dr As OleDb.OleDbDataReader
        Dim cmd As New OleDb.OleDbCommand(sql, cn)
        dr = cmd.ExecuteReader()

[edit]Added vb tags...[/edit]
 
Last edited by a moderator:
Back
Top