i have just installed visual studio 10. Im not familiar with it. I want to connect MDB file to it. I have googled that but could not find appropriate code. So would anyone help me finding the equivalent Visual Studio 10 code to the VB6 code i am pastng below.
Thanks in advance!
Private cn As ADODB.Connection
Private rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Test.mdb;Persist Security Info=false"
cn.Open
Set rs = New ADODB.Recordset
rs.Open "Sample", cn, adOpenKeyset, adLockPessimistic, adCmdTable
rs.MoveFirst
Dim FirstName As String
FirstName = rs.Fields("fname")
rs.Close
cn.close