question

FrancisMkango-0212 avatar image
0 Votes"
FrancisMkango-0212 asked ·

Please help me here am stuck with this error when i try to serach, syntax error(missing operator)in query expression

This is the entire code that am using in vb 2012 ultimate for the search button
Call FrancisDB()

     If txtsearch.Text = "" Then
         MsgBox("PLEASE INSERT EMPLOYEE ID", vbCritical + vbOKOnly, "ST PETER'S ANGLICAN PARISH")
     Else
         Dim SearchNumber As Integer = Me.txtsearch.Text
         rs.Open("Select * From [employees] Where Employee ID=" & SearchNumber & "'", con, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockPessimistic, -1)
         If rs.RecordCount = 0 Then
             MsgBox("RECORD DOES NOT EXIT", vbCritical + vbOKOnly, "ST PETER'S ANGLICAN PARISH")
             rs.Close()

         Else
             txtAddress.Text = rs("Address").Value
             txtContactno.Text = rs("Contact No").Value
             txtDcontract.Text = rs("Duration of Contract").Value
             txtEid.Text = rs("Employee ID").Value
             txtDepartment.Text = rs("Department").Value
             txtFname.Text = rs("Full Name").Value
             txtnrc.Text = rs("NRC").Value
             txtNumChildren.Text = rs("Number of Children").Value
             txtPosition.Text = rs("Position").Value
             cmbgender.Text = rs("Gender").Value
             cmbmstatus.Text = rs("Marital Status").Value
             cmbtcontract.Text = rs("Type of Contract").Value
             dtpDbirth.Text = rs("Date of Birth").Value
             dtpDemployment.Text = rs("Date of Employment").Value
             dtpEcontract.Text = rs("End of Contract").Value
             MsgBox("RECORD FOUND", vbInformation + vbOKOnly, "ST PETER'S ANGLICAN PARISH")
             rs.Close()

         End If
     End If
     con.Close()
not-supported
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DSPatrick avatar image
0 Votes"
DSPatrick answered ·

Visual basic is not currently supported here on QnA. They're actively answering question in dedicated forums here.


https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral

--please don't forget to Accept as answer if the reply is helpful--


Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows Server] Datacenter Management


Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.





· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.