|
-
Aug 16th, 2000, 09:58 AM
#1
Thread Starter
Member
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?
-
Aug 16th, 2000, 10:30 AM
#2
Addicted Member
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 & ";"
-
Aug 17th, 2000, 01:39 AM
#3
Thread Starter
Member
error occur
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
-
Aug 17th, 2000, 12:39 PM
#4
Frenzied Member
How is customer defined in your database? Text or numeric?
-
Aug 17th, 2000, 10:43 PM
#5
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|