Article View: borland.public.cppbuilder.database.multi-tier
Article #36Re: Problem with TDatabase and TParams
From: Romulo
Date: Sun, 07 Dec 2003 02:20
Date: Sun, 07 Dec 2003 02:20
59 lines
2634 bytes
2634 bytes
Hi pascal!.
try this....: (it's very more easy)
//--------------------------------------------------------------------------
-----
DMVentas->DBVentas->StartTransaction();
TQuery* q = new TQuery();
q->DatabaseName = DMVentas->DBVentas->DatabaseName;
q->SQL->Add("Insert Into Project (Codigo, Nombre) Values (:Codigo,
:Nombre)");
q->Prepare(); // if you execute the insert many times.
try
{
q->ParamByName("Codigo")->AsInteger = 1234;
q->ParamByName("Nombre")->AsString = "Karate y ValeTodo es lo
m�ximo.";
q->ExecSQL();
DMVentas->DBVentas->Commit();
}
catch(Exception& e)
{
DMVentas->DBVentas->Rollback();
}
//--------------------------------------------------------------------------
-----
Good Luck, Bye!.
"pascal" <pascal.conrad@actavision.fr> escribi� en el mensaje
news:3f865dbc$1@newsgroups.borland.com...
> Hi,
>
> I've got problem with TDatabase et TParams.
>
> In this code
>
> TParams *Params = new TParams();
> hDBICur Cursor;
>
> try {
> Params->CreateParam(ftString, "Pr_Code", ptInput);
> Params->CreateParam(ftString, "Pr_Caption", ptInput);
> Params->Items[0]->AsString=AnsiString(Code);
> Params->Items[1]->AsString=Pr_Caption->Text;
> SqlCmd="Insert into Project (Pr_Code,Pr_Caption,Pr_BgImage) Values
> (:Pr_Code,:Pr_Caption,'N')";
> DbMkt->Execute(SqlCmd,Param,false,&Cursor);
> } __finally {
> delete Params;
> }
>
>
> He says 'I dont find the object' !
> Why ?
>
> And how can I use hDBICur
>
> Thank's
>
Technical Details
Message-ID:
<3fd28e82@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f865dbc$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: fcd2b,ea371552ff616724 X-Google-Attributes: gidfcd2b,public X-Google-ArrivalTime: 2003-12-06 18:39:09 PST Reply-To: "Romulo" <rubenvive@hotmail.com> From: "Romulo" <rubenvive@hotmail.com> Newsgroups: borland.public.cppbuilder.database.multi-tier References: <3f865dbc$1@newsgroups.borland.com> Subject: Re: Problem with TDatabase and TParams Date: Sat, 6 Dec 2003 23:20:07 -0300 Lines: 61 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 216.155.91.17 Message-ID: <3fd28e82@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1070763650 216.155.91.17 (6 Dec 2003 18:20:50 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail