Results 1 to 3 of 3

Thread: Pipe ("|") Symbol in SQL with access

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2009
    Posts
    264

    Pipe ("|") Symbol in SQL with access

    Hi,

    I'm on VB6 and using the DAO(JET-engine) you have to replace any pipe symbol ("|") in a query with " & CHR(24) & ".
    But now I'm on ADO and am using the Provider=Microsoft.JET.OLEDB... or Driver={Microsoft Access Driver... and it seems it's not necessary anymore, but I'm not certain.
    When using ADO is it still necessary to replace the pipe symbol or can I leave it like it is? (which means I can remove a Replace in my StrQueryString function).

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Pipe ("|") Symbol in SQL with access

    I don't remember any issues with the pipe symbol, but it may be something database or driver specific.

    Note that with a little effort to learn how to use Parameters you can totally avoid the need for replacing anything (including the ' character), and the need to format and delimit dates/numbers/strings when placing them in your SQL statements, and also make your code more secure etc.

    For an explanation of why you should be using parameters (and links to code examples), see the article Why should I use Parameters instead of putting values into my SQL string? from our Database Development FAQs/Tutorials (at the top of this forum).

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2009
    Posts
    264

    Re: Pipe ("|") Symbol in SQL with access

    Yeah, I know about parameters, but this is 'old' code and I don't want to completely rewrite the whole program and every query (that's something I'll do when I'm rewriting it in .NET).

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