Article View: borland.public.cppbuilder.database.ado
Article #205Re: adoquery error
From: bill
Date: Fri, 15 Jun 2007 19:46
Date: Fri, 15 Jun 2007 19:46
24 lines
1986 bytes
1986 bytes
sorry for the post the solutions lies in the ansistring to widestring ,it
works if i do it like:
AnsiString sql="...";
DataModule1->ADOQuery->SQL->ADD(WideString(sql.c_str()));
sorry for the post ,thanks
"bill" <billaras1234@hotmail.com> wrote in message
news:4672e2bd@newsgroups.borland.com...
>i have a very strange problem when executing a sql query from an adoquery
> i want to execute:
> "Insert into table1 values ('abc','def','ghj')"
> this sql statement is executed perfectly when i run it from the database
> (sql server). if i put it in the
> adoquery properties sql it is executed successfully too. but if i do:
> DataModule1->ADOQuery1->SQL->CommaText="Insert into table1 values
> ('abc','def','ghj')";
> DataModule1->ADOQuery1->ExecSQL();
> i get an error "syntax error near def". from many tests i came to realize
> that the problem is the comma after the 'abc'.
> how can i solve this issue?
>
> thank you
>
Technical Details
Message-ID:
<4672ec8e@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.247.MISMATCH!news-xxxfer.readnews.com!news-out.readnews.com!transit4.readnews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4672e2bd@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,5e327e5b8c33feb6 X-Google-Attributes: gid10698b,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "bill" <billaras1234@hotmail.com> Newsgroups: borland.public.cppbuilder.database.ado References: <4672e2bd@newsgroups.borland.com> Subject: Re: adoquery error Date: Fri, 15 Jun 2007 20:46:18 +0100 Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 131.227.231.162 Message-ID: <4672ec8e@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1181936782 131.227.231.162 (15 Jun 2007 12:46:22 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.247.MISMATCH!news-xxxfer.readnews.com!news-out.readnews.com!transit4.readnews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail