i using ADODC to link to my database. If i only want to retrieve particular data where the condition i put in textbox, what should i do?
eg.
Select * from customer
where CustomerCode = text1.text
***this code can't work...what's the correct way?
Printable View
i using ADODC to link to my database. If i only want to retrieve particular data where the condition i put in textbox, what should i do?
eg.
Select * from customer
where CustomerCode = text1.text
***this code can't work...what's the correct way?
Put the contents of the textbox into a variable, then use the variable in the SQL statement. For example:
Dim sText as string
sText = Text1.Text
Adodc1.Recordsource = "SELECT * FROM Customers where Customer = " & sText & ";"
i used the method u guys teach me but it show be error when i run the program
Here is the error message:
if i put the SQL statement in recordsource in properties windows, it show me [ODBC microsoft Access Driver] Data Type mismatch in criteria expression
if i put the SQL statement in coding, it show me [ADODC] no recordsource specified. [ADO] no command has been set for the command object
How is customer defined in your database? Text or numeric?
customer code is numeric