|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
hi
im trying to create a query by comparing a value entered in a text box to a value stored in my db. the code is like this Dim strsearch As String strsearch = txtcust.Text Adodc1.RecordSource = "Select * from tblCustomer Where CustomerId = ' " & strsearch & " '" Adodc1.Refresh this keeps telling me when i run it though that there is a syntax error in the from clause. can anyone help point me to where ive gone wrong? many thanks |
|
#2
|
||||
|
||||
|
if CustomerId is a number and not a string then it should be like this
Code:
Adodc1.RecordSource = "Select * from tblCustomer Where CustomerId = " & strsearch & "" |
|
#3
|
|||
|
|||
|
well that code seems to work for me at the moment because when i run it with and toggle it with a breakpoint the correct values are being filled into the variable.
the main error seems to be the adodc1.refresh line should have stated that a little clearer earlier.sorry. |
|
#4
|
|||
|
|||
|
write me down error message you had get
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > vb + sql query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|