🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Field length problem

#4350
From: Builder
Date: Sun, 13 Jan 2002 11:52
31 lines
1912 bytes
Hello all.

  I'm trying to insert values into an Access 2002 table. Lets assume that I
have only one field in the table and call it date
(represents date in the format mm/yy). My problem is that when I try to set
the field's value to a 5 chars value it doesn't do it. If i try to set it to
a 4 or less char value everything is ok. What's the problem?
The field is declared as follows ( In access):
Field Size:                5
Required :                No
Allow Zero Length:  Yes
Index:                      No
Unicode compr       Yes
The rest are blank

Here's my code ( Importing ActiveX Data Objects v2.5 in BCB 4):

    TCOM_Recordset rs = CoRecordset::Create();
    rs->Open("mytable","DSNName",adOpenDynamic,
     adLockOptimistic,adCmdTable);
    rs->AddNew();
    // This field will stay blank
    rs->Fields_->get_Item("Date")->set_Value("01/01");
   // This field will contain 01/0
   rs->Fields_->get_Item("Date")->set_Value("01/0");
   rs->Update();
   delete rs;

What may be the problem?
Thank you
   Builder
Technical Details
Message-ID: <3c40e850_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!out.nntp.be!propagator-SanJose!in.nntp.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,746c62554cb2af80,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-01-12 17:55:28 PST
From: "Builder" <JohnnyHor@hotmail.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Field length problem
Date: Sun, 13 Jan 2002 03:52:05 -0800
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 62.0.173.218
Message-ID: <3c40e850_1@dnews>
X-Trace: dnews 1010886736 62.0.173.218 (12 Jan 2002 17:52:16 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!out.nntp.be!propagator-SanJose!in.nntp.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews