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:
  1. Imports System.Data.OleDb
  2.  
  3. Module modConnect
  4.  
  5.     Public myConn As New OleDbConnection
  6.     Public myCmd As New OleDbCommand
  7.     Public MyDR As OleDbDataReader
  8.     Public frUpdate As Boolean 'Holding for updating entry
  9.     Public frView As Boolean 'Holding for viewing entry
  10.  
  11.     Public Function IsConnected(ByVal strQry As String, ByVal ver As Boolean)
  12.         Try
  13.  
  14.             If myConn.State = ConnectionState.Open Then myConn.Close()
  15.             myConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\db1.mrk;User Id=admin;Jet OLEDB:Database Password=test"
  16.             myConn.Open()
  17.  
  18.             myCmd.CommandText = strQry
  19.             myCmd.Connection = myConn
  20.  
  21.             If ver = False Then
  22.                 MyDR = myCmd.ExecuteReader()
  23.             Else
  24.                 myCmd.ExecuteNonQuery()
  25.             End If
  26.  
  27.         Catch ex As Exception
  28.             MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
  29.         End Try
  30.     End Function
  31.  
  32. End Module