Link to home
Start Free TrialLog in
Avatar of jjc9809
jjc9809

asked on

I need help with this SQl Statement

Hi Everyone,

I have this SQL Statement that isgiving me a ssyntax error.  What is wrong with the coding?
I have quotes wroing somehow.

This statement should pull a record by a Driver License Number entered in the textbox called strlicense when an event button is selected.

The statement:

Dim strQuery As String = "Select * FROM PersonOfInterest WHERE PK_DriverLicenseID_vch Like '"& strLicense & %'"
SOLUTION
Avatar of Paul Jackson
Paul Jackson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jjc9809
jjc9809

ASKER

Hey guys see the error I am getting.
Error.jpg
if strLicense is the name of a TextBox then replace it with: strLicense.Text

Dim strQuery As String =  "Select * FROM PersonOfInterest WHERE PK_DriverLicenseID_vch Like '" & strLicense.Text & "%'"

Open in new window