Results 1 to 5 of 5

Thread: Sql Statement

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Manchester
    Posts
    446
    I'm having problems using a wildcard in ADO, i do the following, any help welcome...

    str.printf("Select STD, provincebid From PROVINCEB_IDENTIFY where STD like '%s*';",szTempTelCode);
    rs2 = m_db->Execute(mlExecReadWrite,str);

    szTempTelCode is number a like 20300, i then chop a character off each time in a while loop until for instance 203*. there are instances at theis poit but are not detected..


    Gary

    PS: This line however works direct in Access.
    "Life isn't about finding yourself. Life is about creating yourself."
    --George Bernard Shaw

  2. #2
    Member
    Join Date
    Jan 2001
    Location
    Dublin
    Posts
    35
    The wildcard * works in access, but in SQL server it is %, for example:

    Select * from Table Where (Field LIKE 'd%')

    not

    Select * from Table Where (Field LIKE 'd*')

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Manchester
    Posts
    446

    which

    Whcih uses SQL ASP OR C++ i'm connectiing with the ADO object?

    Gary
    "Life isn't about finding yourself. Life is about creating yourself."
    --George Bernard Shaw

  4. #4
    Member
    Join Date
    Jan 2001
    Location
    Dublin
    Posts
    35
    I don't understand your last question.

    When using ADO with SQL Server, always use % as the wildcard instead of *.

    Does this solve your problem.

    Nialler

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Manchester
    Posts
    446

    yep

    yep... Access is the pain..
    "Life isn't about finding yourself. Life is about creating yourself."
    --George Bernard Shaw

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