Hey Guys,
I was wondering if you could help me out please.
What i'm trying to do is load my information from my access 2000 database the table is called Product and the field is called DVDs what i want it to do is load the DVD's in to the combobox its called cboProduct and when they select a dvd it shows the cost in txtCost on my form this is my connection module code?.
code Code:
Imports System.Data.OleDb Module modConnect Public myConn As New OleDbConnection Public myCmd As New OleDbCommand Public MyDR As OleDbDataReader Public frUpdate As Boolean 'Holding for updating entry Public frView As Boolean 'Holding for viewing entry Public Function IsConnected(ByVal strQry As String, ByVal ver As Boolean) Try If myConn.State = ConnectionState.Open Then myConn.Close() myConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\db1.mrk;User Id=admin;Jet OLEDB:Database Password=test" myConn.Open() myCmd.CommandText = strQry myCmd.Connection = myConn If ver = False Then MyDR = myCmd.ExecuteReader() Else myCmd.ExecuteNonQuery() End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Error") End Try End Function End Module




Reply With Quote