Thread View: borland.public.cppbuilder.database.ado
3 messages
3 total messages
Started by cristof
Wed, 04 Apr 2001 16:44
ADO with BCB4, stored proc usage.
Author: cristof
Date: Wed, 04 Apr 2001 16:44
Date: Wed, 04 Apr 2001 16:44
9 lines
1284 bytes
1284 bytes
Hi all ! I'm looking for passing a null parameter to a stored proc, using ADO in BCB4 with a SQL Server database. I'm using a connection object, and then a command object, and then parameter objects, but when i call the execute command and one of my params is null, i does'nt work. What properties should i define in my Parameter object ? Thx if you have an idea or an example.
Re: ADO with BCB4, stored proc usage.
Author: Alan Lichtenstein
Date: Wed, 04 Apr 2001 22:49
Date: Wed, 04 Apr 2001 22:49
26 lines
1668 bytes
1668 bytes
Try something like this, with m_pStp a pointer to a TADOStoredProc object
and m_pTbl a pointer to a TADOTable object :
m_pStp->Parameters->CreateParameter("paramTaxid", ftString, pdInput,
20, NULL );
m_pStp->Parameters->Items[1]->Value =
m_pTbl->FieldByName("Taxid")->AsString;
Note: The documentation states that when NULL is passed the size (i.e. 20)
must be greater than zero....
cristof wrote in message <3acb4eef_1@dnews>...
>Hi all !
>
>I'm looking for passing a null parameter to a stored proc, using ADO in
BCB4
>with a SQL Server database.
>I'm using a connection object, and then a command object, and then
parameter
>objects, but when i call the execute command and one of my params is null,
i
>does'nt work.
>What properties should i define in my Parameter object ?
>Thx if you have an idea or an example.
>
>
Re: ADO with BCB4, stored proc usage.
Author: Alan Lichtenstein
Date: Thu, 05 Apr 2001 14:24
Date: Thu, 05 Apr 2001 14:24
31 lines
1650 bytes
1650 bytes
Try something like this:
m_pStp->Parameters->CreateParameter("paramTaxid", ftString, pdInput,
20, NULL );
m_pStp->Parameters->Items[0]->Value =
m_pTbl->FieldByName("Client")->AsString
Note: The documentation states that when passing NULL as the value
parameter,
the SIZE parameter ( i.e. 20 ) must be set to a value greater
than zero...
;
cristof wrote in message <3acb4eef_1@dnews>...
>Hi all !
>
>I'm looking for passing a null parameter to a stored proc, using ADO in
BCB4
>with a SQL Server database.
>I'm using a connection object, and then a command object, and then
parameter
>objects, but when i call the execute command and one of my params is null,
i
>does'nt work.
>What properties should i define in my Parameter object ?
>Thx if you have an idea or an example.
>
>
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