Re: Handle double quote in VB for MS Access

From: William \(Bill\) Vaughn (billvaRemoveThis_at_nwlink.com)
Date: 07/14/04


Date: Wed, 14 Jul 2004 11:34:51 -0700

Build a Command object with parameters and let ADO figure out the framing
for you. It works every time.

-- 
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"barani" <barani_man@hotmail.com> wrote in message
news:eWUKh7VaEHA.644@tk2msftngp13.phx.gbl...
> Hi,
>
> I have an application with VB as front end and MS Access as back end.
>
> For querying data, I am using ADO Connection object.
>
> I have a table with user name and password and some other fields in it.
>
> If I use the following query in VB, on execution of
ConnectionObject.Execute
> ("...."), I am getting the following error.
> Query
> -------
> SELECT * FROM UserDomainProfile WHERE UCase(UserID) = 'BARANI' AND
Password
> = '3""  '
>
> Error
> -------
>   Syntax error in string in query expression 'UCase(UserID) = 'BARANI' AND
> Password = '3"" '
>
> But, if I execute the same query in SQL View of MS Access, I didn't get
the
> above error and I am getting the output.
> Help me to solve the above problem
>
> ===>Barani
>
>


Relevant Pages

  • Re: cant get query to run over ADO, but works fine in Access interfac
    ... If an SQL statement runs in Query Analyzer (or some other interface), ... should be able to execute it using an ADO Command object. ...
    (microsoft.public.data.ado)
  • Re: Inserting Records Into Access Table via DAO
    ... > I'm used to using the command object in ADO to insert records into an SQL ... Another way is to use the RunSQL command object. ... Dim iIntVal as integer ... The downside is that the query will not be optimized. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Command object and batching stored procedure calls
    ... of the ADO Command object. ... you are reading the ADO documentation: ... a Command object, or what the maximum length is or something. ... returned by your batch's execution. ...
    (microsoft.public.data.ado)
  • RE: ODBC query in VB code Need HELP
    ... Everything for ADO is in the first 2 messages that I gave you. ... Since your pass-through query already exists (including the ... Dim STRSQL As String ...
    (microsoft.public.access.formscoding)
  • Re: Connecting to Query
    ... practice examples of the ADO Command, Parameters, etc. you explained below. ... Second, with the selected territory ... >> combo box to select a product from a query based primarily on a link ...
    (microsoft.public.access.formscoding)