table doesn't have primary key (already tried other people's solutions, also my database table has a primary key!) RRS feed

  • Question

  • Dim con As New OleDb.OleDbConnection
        Dim da As New OleDb.OleDbDataAdapter
        Dim ds As New DataSet
        Dim sql As String
        Dim pass As Integer
        Dim cmd As New OleDb.OleDbCommand
        Dim dr As OleDb.OleDbDataReader
        Dim dRow As DataRow

    con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Drug Emporium.accdb"
            cmd.CommandText = "Select * From Inventory"
            cmd.CommandType = CommandType.Text
            cmd.Connection = con
            sql = "Select * From Inventory"
            dr = cmd.ExecuteReader()
            da = New OleDb.OleDbDataAdapter(sql, con)
            da.FillSchema(ds, SchemaType.Source, "Drug Emprorium")
            da.Fill(ds, "Drug Emporium")
            Dim cb As New OleDb.OleDbCommandBuilder(da)
            dRow = ds.Tables("Drug Emporium").Rows.Find(intItemNum)

    Thursday, February 20, 2014 6:06 AM


  • Hello CUAlabears,

    “Drug Emprorium” is not equal with “Drug Emporium”, the first has one more “r” inside it.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 21, 2014 9:48 AM