View Full Version : Connecting VB 6.0 and vb.net to access, or mysql.
briintex1
07-24-2005, 03:52 AM
I was wondering if someone could help me with connecting access to either vb.net or vb6.0. I know that xp was able to convert access to 97, and I could use access then. But is there a way to do this with access2003? I thought perhaps vb.net might be able to do it...since it is the new up and coming thing. But any help would be greatly appreciated. I am create databases...also would it be easier to install mysql and use odbc and connect it that way, if that is the case would you prefer .net or 6.0? Sorry about all of the rambling on...
Brandoe85
07-25-2005, 05:40 PM
Sure, a .NET way:
Imports System.Data.OleDb
.........
Dim con As String, myConnection As New OleDbConnection
con = "path to your db"
Try
myConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & con
myConnection.Open()
Catch ex As OleDbException
MessageBox.Show(ex.Message.ToString())
End Try
' close your connection when you're finished!
Also, check out Connection strings (http://www.connectionstrings.com/)
Good luck;
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.