🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
3 messages
3 total messages Started by Joe L. Fri, 25 May 2007 15:51
Using ADO - How do I set a Parameter from a VALUE to NULL in Code
#184
Author: Joe L.
Date: Fri, 25 May 2007 15:51
23 lines
1768 bytes
I'm new to ADO and Database programming in C++ Builder.  I'm using the 
C++ Builder Profile in BDS 2006.

I have an application that uses parameters in ADOCommands (created at 
Design Time) to Query Data and Perform inserts into application tables 
in Oracle.  The parameters are set in the code, based on information 
that needs to be inserted into the table.

Some of the parameters have been created, and are set with default 
values at Design time.  These are not touched again in the code.

I've tried:

ADOCommand1->Parameters->ParamByName("FieldName")->Value.Clear();

Before checking to see if there is a value that needs to be set, but the 
parameter doesn't seem to be set to NULL. So once it is set, the value 
propagates into other records, that are supposed to be NULL.

I appreciate any help that you can offer.

Thanks,
Joe
Re: Using ADO - How do I set a Parameter from a VALUE to NULL in Code
#185
Author: Clayton Arends
Date: Fri, 25 May 2007 22:36
7 lines
1222 bytes
Try setting the variant's value to Null().  NULL is not the same as Null() 
and using the first is a common mistake (even for those of us that work with 
this stuff all the time).

HTH,

- Clayton 
Re: Using ADO - How do I set a Parameter from a VALUE to NULL in Code
#189
Author: Joe L.
Date: Fri, 01 Jun 2007 04:18
8 lines
1177 bytes
Thanks... That is exactly what I needed.

Joe



Clayton Arends wrote:
> Try setting the variant's value to Null().  
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