"UPDATE customer SET name=" Jonan's.p" WHERE custId=5 what is error 
Author Message
 "UPDATE customer SET name=" Jonan's.p" WHERE custId=5 what is error

        sql="UPDATE "+strDestTable+" SET "+strDestColName+"=\""+strData+"\"
WHERE "+strSrcCtrlFld+" ="+strWhereData;
        recordset=Connnnectionprt->Execute(sql.operator
LPCTSTR(),&vNull,adOptionUnspecified);
    here result of SQL is
    sql="UPDATE customer SET name=" Jonan's.p" WHERE
custId=5"------------------------------(1)
  but the ADO unable to execute this statement  why? is there any error
when this SQL is like this
sql=="UPDATE customer SET name=' Jonans.p' WHERE custId=5"  it's  working
file-----------------(2)

what is wrong in (1) if the name has like this (Jonam's)  (2) it also given
error plz clarify this



Mon, 25 Oct 2004 18:26:09 GMT  
 "UPDATE customer SET name=" Jonan's.p" WHERE custId=5 what is error
veeruchowdary

The following is an example showing the general syntax of the SQL Update
command:

wchar_t *sql = L"UPDATE MyTable SET Firstname='Roys Data' WHERE cid=9";

When you have embedded quotes or the double quote symbol with is segment
delimited by the same quoted character, you must use the double of the same.
Consider the following:

/* ***************************** */
int main(int argc, char* argv[]){
::CoInitialize(NULL);
_ConnectionPtr cnxion;

cnxion.CreateInstance(__uuidof(Connection));
cnxion->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\DevPrograms\\groups.mdb;","","",adConnectUnspecified);
_variant_t recCnt = (short)0;
try{
 cnxion->Execute(L"Update Table1 Set DataField='Roy''s Own Data' where
pkCid=1",&recCnt,adCmdText);
 }
catch(_com_error &e){
 _bstr_t desc = e.Description();
 _bstr_t em = e.ErrorMessage();
 }

return 0;

Quote:
}

Note that the string "Roy's Own Data" is embedded within the SQL text
string(which is delimited with a double quote pair), so we switch to single
quotes on the assignment string (i.e. the rvalue).  But the assignment string
also has an embedded quote, so for this we signify same with the double single
quote.

I hope this helps.

best regards
roy fine


Quote:
>         sql="UPDATE "+strDestTable+" SET "+strDestColName+"=\""+strData+"\"
> WHERE "+strSrcCtrlFld+" ="+strWhereData;
>         recordset=Connnnectionprt->Execute(sql.operator
> LPCTSTR(),&vNull,adOptionUnspecified);
>     here result of SQL is
>     sql="UPDATE customer SET name=" Jonan's.p" WHERE
> custId=5"------------------------------(1)
>   but the ADO unable to execute this statement  why? is there any error
> when this SQL is like this
> sql=="UPDATE customer SET name=' Jonans.p' WHERE custId=5"  it's  working
> file-----------------(2)

> what is wrong in (1) if the name has like this (Jonam's)  (2) it also given
> error plz clarify this



Tue, 26 Oct 2004 08:56:45 GMT  
 "UPDATE customer SET name=" Jonan's.p" WHERE custId=5 what is error
Roy Fine
thank u very much for u r help Mr.Roy Fine.

regards
veeru


Quote:
> veeruchowdary

> The following is an example showing the general syntax of the SQL Update
> command:

> wchar_t *sql = L"UPDATE MyTable SET Firstname='Roys Data' WHERE cid=9";

> When you have embedded quotes or the double quote symbol with is segment
> delimited by the same quoted character, you must use the double of the
same.
> Consider the following:

> /* ***************************** */
> int main(int argc, char* argv[]){
> ::CoInitialize(NULL);
> _ConnectionPtr cnxion;

> cnxion.CreateInstance(__uuidof(Connection));
> cnxion->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:\\DevPrograms\\groups.mdb;","","",adConnectUnspecified);
> _variant_t recCnt = (short)0;
> try{
>  cnxion->Execute(L"Update Table1 Set DataField='Roy''s Own Data' where
> pkCid=1",&recCnt,adCmdText);
>  }
> catch(_com_error &e){
>  _bstr_t desc = e.Description();
>  _bstr_t em = e.ErrorMessage();
>  }

> return 0;
> }

> Note that the string "Roy's Own Data" is embedded within the SQL text
> string(which is delimited with a double quote pair), so we switch to
single
> quotes on the assignment string (i.e. the rvalue).  But the assignment
string
> also has an embedded quote, so for this we signify same with the double
single
> quote.

> I hope this helps.

> best regards
> roy fine



> >         sql="UPDATE "+strDestTable+" SET

"+strDestColName+"=\""+strData+"\"

- Show quoted text -

Quote:
> > WHERE "+strSrcCtrlFld+" ="+strWhereData;
> >         recordset=Connnnectionprt->Execute(sql.operator
> > LPCTSTR(),&vNull,adOptionUnspecified);
> >     here result of SQL is
> >     sql="UPDATE customer SET name=" Jonan's.p" WHERE
> > custId=5"------------------------------(1)
> >   but the ADO unable to execute this statement  why? is there any error
> > when this SQL is like this
> > sql=="UPDATE customer SET name=' Jonans.p' WHERE custId=5"  it's
working
> > file-----------------(2)

> > what is wrong in (1) if the name has like this (Jonam's)  (2) it also
given
> > error plz clarify this



Tue, 26 Oct 2004 12:31:16 GMT  
 "UPDATE customer SET name=" Jonan's.p" WHERE custId=5 what is error
my pleasure,
rlf


Quote:
> Roy Fine
> thank u very much for u r help Mr.Roy Fine.

> regards
> veeru



> > veeruchowdary

> > The following is an example showing the general syntax of the SQL Update
> > command:

> > wchar_t *sql = L"UPDATE MyTable SET Firstname='Roys Data' WHERE cid=9";

> > When you have embedded quotes or the double quote symbol with is segment
> > delimited by the same quoted character, you must use the double of the
> same.
> > Consider the following:

> > /* ***************************** */
> > int main(int argc, char* argv[]){
> > ::CoInitialize(NULL);
> > _ConnectionPtr cnxion;

> > cnxion.CreateInstance(__uuidof(Connection));
> > cnxion->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data
> > Source=C:\\DevPrograms\\groups.mdb;","","",adConnectUnspecified);
> > _variant_t recCnt = (short)0;
> > try{
> >  cnxion->Execute(L"Update Table1 Set DataField='Roy''s Own Data' where
> > pkCid=1",&recCnt,adCmdText);
> >  }
> > catch(_com_error &e){
> >  _bstr_t desc = e.Description();
> >  _bstr_t em = e.ErrorMessage();
> >  }

> > return 0;
> > }

> > Note that the string "Roy's Own Data" is embedded within the SQL text
> > string(which is delimited with a double quote pair), so we switch to
> single
> > quotes on the assignment string (i.e. the rvalue).  But the assignment
> string
> > also has an embedded quote, so for this we signify same with the double
> single
> > quote.

> > I hope this helps.

> > best regards
> > roy fine



> > >         sql="UPDATE "+strDestTable+" SET
> "+strDestColName+"=\""+strData+"\"
> > > WHERE "+strSrcCtrlFld+" ="+strWhereData;
> > >         recordset=Connnnectionprt->Execute(sql.operator
> > > LPCTSTR(),&vNull,adOptionUnspecified);
> > >     here result of SQL is
> > >     sql="UPDATE customer SET name=" Jonan's.p" WHERE
> > > custId=5"------------------------------(1)
> > >   but the ADO unable to execute this statement  why? is there any
error
> > > when this SQL is like this
> > > sql=="UPDATE customer SET name=' Jonans.p' WHERE custId=5"  it's
> working
> > > file-----------------(2)

> > > what is wrong in (1) if the name has like this (Jonam's)  (2) it also
> given
> > > error plz clarify this



Wed, 27 Oct 2004 02:59:32 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Displaying binary data as ascii "1"'s and "0"'s

2. Displaying binary data as ascii "1"'s and "0"'s

3. '.', '::", "->"

4. interesting statement: name = (name)?name:"";

5. CRecordset's Update seems "delayed"

6. remove() vrs fopen("""w")

7. Looking for "Shroud"/"Obfus"

8. ""help with TSR""

9. Parse trees and "("")"

10. Error "free"-ing "malloc"-ed memory

11. I am going to study "C"

12. #define "name.h" "NAME.H"

 

 
Powered by phpBB® Forum Software