hello im working with vb 2010 and ms access as data base, just newbie.im trying to save the loged out date and time to my access table by selecting from tblloghist wherein my column SystemUserID is equal to my textbox SysID(located at my form) then it will save the timelogedout by getting the value of lbltime from my form.
the problem is the data type property of my column SystemUserId is in autonumber so i got error saying "Data type mismatch in criteria expression"
quite confusing hope someone will help..


            Dim con As New OleDbConnection
            con.ConnectionString = "Provider=microsoft.jet.oledb.4.0; data source =..\systemsdb.mdb"

                Dim ds As New DataSet
                Dim dt As New DataTable
                Dim da As New OleDbDataAdapter

            da = New OleDbDataAdapter("select * from tblloghist WHERE SystemUserID  = '" & SysID.Text & "'", con)
                Dim newRow As DataRow = dt.NewRow

                With newRow
                .Item("TimeLogedOut") = lbltime.Text
                End With

                Dim cb As New OleDbCommandBuilder(da)

        Catch ex As Exception
        End Try
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.