Sending a query to ADO with then character 39 :'


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Sending a query to ADO with then character 39 :'

  1. #1
    Jean-Claude LEPOT Guest

    Sending a query to ADO with then character 39 :'


    I can't send a query to an ADO object if the query text contain the character
    ascii 39. I'had try to double it (it works well when i work with the net
    library accessing SQL Server Databases) but it occurs an error in this case
    also.

    The only solution i find is to send a query with db library, on doubling
    the caracter to obtain the ID (field as int primary key), then i make a new
    query to find this ID in the ADO object... I works but it is'nt very nice,
    no ?

    Thank's if you have a solution.
    Share on Google+

  2. #2
    Bill Vaughn Guest

    Re: Sending a query to ADO with then character 39 :'


    I call this the "O'Malley" problem. It can be solved by letting ADO handle
    the parameters for you (via a Command object and a Parameters collection)
    or by doubling the single quote. If done right, either technique works.

    bv

    "Jean-Claude LEPOT" <jclepot@wineandco.com> wrote:
    >
    >I can't send a query to an ADO object if the query text contain the character
    >ascii 39. I'had try to double it (it works well when i work with the net
    >library accessing SQL Server Databases) but it occurs an error in this case
    >also.
    >
    >The only solution i find is to send a query with db library, on doubling
    >the caracter to obtain the ID (field as int primary key), then i make a

    new
    >query to find this ID in the ADO object... I works but it is'nt very nice,
    >no ?
    >
    >Thank's if you have a solution.


    Share on Google+

Similar Threads

  1. But..Re: Pass value to ADO query
    By Tom Wilson in forum VB Classic
    Replies: 0
    Last Post: 10-06-2000, 03:06 PM
  2. But..Re: Pass value to ADO query
    By Mike in forum VB Classic
    Replies: 0
    Last Post: 10-06-2000, 01:48 PM
  3. ADO - T-SQL - Stored Proc Question
    By Neil Whitlow in forum VB Classic
    Replies: 2
    Last Post: 08-23-2000, 01:24 AM
  4. Stored Procedure - ADO - T-SQL Question
    By Neil Whitlow in forum Database
    Replies: 3
    Last Post: 08-20-2000, 11:38 AM
  5. ADO query timeout
    By chaumette in forum VB Classic
    Replies: 2
    Last Post: 03-31-2000, 11:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center