Thread View: borland.public.delphi.database.ado-net
4 messages
4 total messages
Started by Don
Wed, 02 Mar 2005 17:04
TADOCommand Insert parameters
Author: Don
Date: Wed, 02 Mar 2005 17:04
Date: Wed, 02 Mar 2005 17:04
20 lines
1703 bytes
1703 bytes
I am having problems creating a parameterized Insert query using
TADOCommand. This is for a VCL .Net application(no WinForm/BDP).
The command text (SQL Server 2k):
INSERT dbo.BatchInfo (fileId, generationDate, cardProductId)
VALUES (':fileId', ':generationDate', ':cardProductId')
After setting the CommandText property the parameters don't
show up in the parameter editor. After manual setting them if I either modify the CommandText property, or open SQL Builder the
manually added edits get deleted.
After executing the command at runtime the strings :fileId,
:generationDate, and :cardProductId show up in the columns
instead of the actual values. I set the values by:
InsBatchInfo.Parameters.ParamByName('fileId').Value := '1';
or ".".Items[0].Value := '1';
Any ideas on what I'm doing wrong !?
Re: TADOCommand Insert parameters
Author: Ramesh Theivendran(Borland)
Date: Wed, 02 Mar 2005 19:03
Date: Wed, 02 Mar 2005 19:03
31 lines
2045 bytes
2045 bytes
> VALUES (':fileId', ':generationDate', ':cardProductId')
I see a problem in the param list. try to remove the quotes.
Please post ADO issue in the ADO group.
T.Ramesh.
"Don" <d.haas@datatrac-dc.com> wrote in message
news:4225f227$1@newsgroups.borland.com...
>
> I am having problems creating a parameterized Insert query using
> TADOCommand. This is for a VCL .Net application(no WinForm/BDP).
>
> The command text (SQL Server 2k):
> INSERT dbo.BatchInfo (fileId, generationDate, cardProductId)
> VALUES (':fileId', ':generationDate', ':cardProductId')
>
> After setting the CommandText property the parameters don't
> show up in the parameter editor. After manual setting them if I either
modify the CommandText property, or open SQL Builder the
> manually added edits get deleted.
>
> After executing the command at runtime the strings :fileId,
> :generationDate, and :cardProductId show up in the columns
> instead of the actual values. I set the values by:
>
> InsBatchInfo.Parameters.ParamByName('fileId').Value := '1';
> or ".".Items[0].Value := '1';
>
> Any ideas on what I'm doing wrong !?
>
Re: TADOCommand Insert parameters
Author: Don
Date: Wed, 02 Mar 2005 22:53
Date: Wed, 02 Mar 2005 22:53
47 lines
2586 bytes
2586 bytes
D2k5 wouldn't recognize the params w/o quotes (:MyParam). The
resolution was to use ? in the values list for each SQL
parameter. Although, Query Analyzer didn't like that syntax.
I'm sorry, but I thought borland.public.delphi.database.ado-net
would be the most appropriate place for this post. This is a
VCL for Delphi .Net application using the DBGo components . . .
Thanks for the prompt reply,
Don
"Ramesh Theivendran\(Borland\)" <Ramesh.Theivendran@borland.com> wrote:
>> VALUES (':fileId', ':generationDate', ':cardProductId')
>I see a problem in the param list. try to remove the quotes.
>
>Please post ADO issue in the ADO group.
>
>T.Ramesh.
>
>"Don" <d.haas@datatrac-dc.com> wrote in message
>news:4225f227$1@newsgroups.borland.com...
>>
>> I am having problems creating a parameterized Insert query using
>> TADOCommand. This is for a VCL .Net application(no WinForm/BDP).
>>
>> The command text (SQL Server 2k):
>> INSERT dbo.BatchInfo (fileId, generationDate, cardProductId)
>> VALUES (':fileId', ':generationDate', ':cardProductId')
>>
>> After setting the CommandText property the parameters don't
>> show up in the parameter editor. After manual setting them if I either
>modify the CommandText property, or open SQL Builder the
>> manually added edits get deleted.
>>
>> After executing the command at runtime the strings :fileId,
>> :generationDate, and :cardProductId show up in the columns
>> instead of the actual values. I set the values by:
>>
>> InsBatchInfo.Parameters.ParamByName('fileId').Value := '1';
>> or ".".Items[0].Value := '1';
>>
>> Any ideas on what I'm doing wrong !?
>>
>
>
Re: TADOCommand Insert parameters
Author: A Baker
Date: Mon, 20 Jun 2005 22:07
Date: Mon, 20 Jun 2005 22:07
67 lines
3210 bytes
3210 bytes
Don
Try this:
INSERT dbo.BatchInfo (fileId, generationDate, cardProductId)
VALUES (:fileId, :generationDate, :cardProductId)
and now the parameters should be visoible and you can assign the value as
you mentioned.
Good luck!
Baker
"Don" <d.haas@datatrac-dc.com> wrote in message
news:422643d7$1@newsgroups.borland.com...
>
> D2k5 wouldn't recognize the params w/o quotes (:MyParam). The
> resolution was to use ? in the values list for each SQL
> parameter. Although, Query Analyzer didn't like that syntax.
>
> I'm sorry, but I thought borland.public.delphi.database.ado-net
> would be the most appropriate place for this post. This is a
> VCL for Delphi .Net application using the DBGo components . . .
>
> Thanks for the prompt reply,
>
> Don
>
> "Ramesh Theivendran\(Borland\)" <Ramesh.Theivendran@borland.com> wrote:
>>> VALUES (':fileId', ':generationDate', ':cardProductId')
>>I see a problem in the param list. try to remove the quotes.
>>
>>Please post ADO issue in the ADO group.
>>
>>T.Ramesh.
>>
>>"Don" <d.haas@datatrac-dc.com> wrote in message
>>news:4225f227$1@newsgroups.borland.com...
>>>
>>> I am having problems creating a parameterized Insert query using
>>> TADOCommand. This is for a VCL .Net application(no WinForm/BDP).
>>>
>>> The command text (SQL Server 2k):
>>> INSERT dbo.BatchInfo (fileId, generationDate, cardProductId)
>>> VALUES (':fileId', ':generationDate', ':cardProductId')
>>>
>>> After setting the CommandText property the parameters don't
>>> show up in the parameter editor. After manual setting them if I either
>>modify the CommandText property, or open SQL Builder the
>>> manually added edits get deleted.
>>>
>>> After executing the command at runtime the strings :fileId,
>>> :generationDate, and :cardProductId show up in the columns
>>> instead of the actual values. I set the values by:
>>>
>>> InsBatchInfo.Parameters.ParamByName('fileId').Value := '1';
>>> or ".".Items[0].Value := '1';
>>>
>>> Any ideas on what I'm doing wrong !?
>>>
>>
>>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads