Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • Leaders
Posted (edited)

Yep it's 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.

 

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]

Edited by divil
--tim
Posted
! I haven't played with ADO.NET yet, but shouldn't there be cn.Close() at the end of that code? :eek:
Gamer extraordinaire. Programmer wannabe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...