🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #3933

Re: Default values on insert MSSQL7

#3933
From: Robi Kihm
Date: Sun, 19 May 2002 22:54
60 lines
2621 bytes
I have some more data on this problem

The null values can be caused by doing this
DataSet->FieldValues["FieldName"] = "";

This used to work fine in the BDE , but not with ADO / Adonis Components.
Why ????? , a "" is an empty string , NOT  a NULL (as far as I understand ?)


Is there a simple fix for this , as I really wish to avoid having to put in
tons of code
just to fix this.

Regards

Robi




"Robi Kihm" <robi_kihm@yebo.co.za> wrote in message news:3ce7b2a9_2@dnews...
> Hi
>
> I am not sure if this question has been asked before , I have
> searched hi and lo for an answer , but cannot get anything specific
>
> The problem is
>
> I have a MSSQL table with all columns defined as NOT NULL , with
approriate
> default values defined in the table def.
>
> If I issue a insert into table (Field1,Field2) values ('a','b') from Query
> Analyzer
> all non specified fields in the insert update with their correct DEFAULT
> values.
>
> Using ADO (Adonis dataset) , adding a new record from a dbgrid into the
> same table give a 'non null column cannot be updated with a null value' or
> some
> such equivelant message. If I set the table fields on MSSQL to allow NULLS
,
> with
> default values , the update goes through , however all non updated fields
> are set to NULL , completely ignoring the table definitions default values
> !.
>
> I have tried to change marshall options to mrALL with no effect.
>
> I am using the OLEDB provider for MSSQL , CBuilder 5 , Adonis Dataset
>
> Puuuhhhlease could some one help me with this ?
>
> Regards
>
> Robi Kihm
>
>
>
>
Technical Details
Message-ID: <3ce82cb7_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-out.spamkiller.net!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3ce7b2a9_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,91a05a39a1e8ee58
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-05-19 15:59:56 PST
Reply-To: "Robi Kihm" <robi_kihm@yebo.co.za>
From: "Robi Kihm" <robi_kihm@yebo.co.za>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3ce7b2a9_2@dnews>
Subject: Re: Default values on insert MSSQL7
Date: Mon, 20 May 2002 00:54:04 +0200
Lines: 62
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 155.239.72.223
Message-ID: <3ce82cb7_1@dnews>
X-Trace: dnews 1021848759 155.239.72.223 (19 May 2002 15:52:39 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-out.spamkiller.net!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews