Results 1 to 5 of 5

Thread: ADODC help

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    Penang, Malaysia
    Posts
    51

    Question

    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?

  2. #2
    Addicted Member P.S.W.'s Avatar
    Join Date
    Aug 2000
    Posts
    146
    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 & ";"





  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    Penang, Malaysia
    Posts
    51

    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

  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    How is customer defined in your database? Text or numeric?

  5. #5

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    Penang, Malaysia
    Posts
    51
    customer code is numeric

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width