Hello, I'm new to VB.net upgrading from VB6. I use the following code to in VB6 to access a MS access database and fill a comboBox:
My question is what would the code look like for the same process in Vb.net?
I have a start with the following code:
Thanks for any help!!
MS
Code:
Dim db1 As DAO.Database
Dim rst1 As DAO.Recordset
Set db1 = DBEngine.OpenDatabase("c:\program files\acs\acs sales.mdb")
'Open the Recordset
Set rst1 = db1.OpenRecordset("comm")
rst1.MoveFirst
While Not rst1.EOF
Combo4.AddItem rst1!commRate
On Error Resume Next
Combo10.AddItem rst1!selfLeadFee
rst1.MoveNext
Wend
rst1.Close
db1.Close
I have a start with the following code:
Code:
Private m_cnADONetConnection As New OleDb.OleDbConnection
Private m_daDataAdapter As New OleDb.OleDbDataAdapter
' in the Form1_Load section
m_cnADONetConnection.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\program files\acs\acs sales.mdb"
m_cnADONetConnection.Open()
Thanks for any help!!
MS