Results 1 to 3 of 3

Thread: Invalid char in SQL in VB6 with Access97 ?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Location
    the Netherlands
    Posts
    24

    Invalid char in SQL in VB6 with Access97 ?

    Hi all,

    What's wrong with the next SQL-statement in VB6-code using ADO
    to retrieve a recordset from an Access-database (97)

    "SELECT ZAN_KNA1.KUNNR, ZAN_KNA1.NAME1, ZAN_KNA1.STRAS, ZAN_KNA1.PSTLZ, ZAN_KNA1.ORT01, ZAN_KNA1.LAND1, ZAN_KNA1.LOEVM From ZAN_KNA1 WHERE (((ZAN_KNA1.NAME1) Like " % " & [m_Name] & " % ") AND ((ZAN_KNA1.ORT01) Like " % " & [m_City] & " % ") AND ((ZAN_KNA1.LAND1) Like " % " & [m_Country] & " % "))"

    m_Name etc. are variables with normal values.
    % is the wildcard.

    Help would be wonderful,

    Greetings, Ger.

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Location
    the Netherlands
    Posts
    24
    Sorry, but i got an error

    Ïnvalid character for the % ????????

    Ger.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Location
    the Netherlands
    Posts
    24

    Talking

    And when I change the % in a *, then the syntax is OK, but when
    i run the program i got an error TypeMismatch ?????


    ohoh, i cannot sleep of it !

    Ger

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