Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27036

VS 2008 Search in access table

$
0
0
Hi to all.
I'm new in VB and now i'm trying to search an access table to see if is existing related records.
I have try this code but i take back TRUE even there is no related records.

Thanks!!!!!!!

Code:

    Private Sub Check_Movement_Roller(ByVal Work_Roller As Integer)
        Dim con As OleDbConnection = New OleDbConnection(Main_Form.ConString)
        Dim dr As System.Data.OleDb.OleDbDataReader
        cmd = New OleDbCommand("SELECT count(*) FROM Movement_roller WHERE Movement_roller.movement_roller_roller=" & Work_Roller, con)
        con.Open()
        cmd.Connection = con
        dr = cmd.ExecuteReader
        W_Movement_Roller = False
        If dr.FieldCount > 0 Then
            W_Movement_Roller = True
        Else
            W_Movement_Roller = False
        End If
    End Sub


Viewing all articles
Browse latest Browse all 27036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>