PDA

Click to See Complete Forum and Search --> : ADODC help


leeckeat
Aug 16th, 2000, 09:58 AM
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?

P.S.W.
Aug 16th, 2000, 10:30 AM
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 & ";"

leeckeat
Aug 17th, 2000, 01:39 AM
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

JHausmann
Aug 17th, 2000, 12:39 PM
How is customer defined in your database? Text or numeric?

leeckeat
Aug 17th, 2000, 10:43 PM
customer code is numeric