🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Question on using class TADOTable

#4454
From: hugsnow Luo
Date: Wed, 02 Jan 2002 16:18
44 lines
2330 bytes
i think that you call Edit() method before call Append() method.
like this:

MainFrm->ADOTable1->Active=true;
MainFrm->ADOTable1->Last();
MainFrm->ADOTable1->Edit();  //Add this line
MainFrm->ADOTable1->Append();
MainFrm->ADOTable1->FieldValues["ID"]=id+1;
MainFrm->ADOTable1->FieldValues["Name"]=_Name;
MainFrm->ADOTable1->Post();
MainFrm->ADOTable1->Active=false;



Joe Lam wrote:

> Hi,
> 
> I am using BC++ 5.0 and developing some application with MSAccess DB,
> but I faced the following error during my development:
> 
> RunTime Error:
> --------------
> Project Project.exe raised exception class EOleException
> with message 'CoInitialize has not been called'.
> Process stopped. Use Step or Run to continue.
> 
> 
> Error occurs when running the following codes:
> ----------------------------------------------
> MainFrm->ADOTable1->Active=true;
> MainFrm->ADOTable1->Last();
> MainFrm->ADOTable1->Append();
> MainFrm->ADOTable1->FieldValues["ID"]=id+1;
> MainFrm->ADOTable1->FieldValues["Name"]=_Name;
> MainFrm->ADOTable1->Post();
> MainFrm->ADOTable1->Active=false;
> -----------------------------------------------
> I used ADOTable to connection to a MSAccess database, it works properly
> several months before, but it causes this run time error. Can anyone tell
> why I got this error message?
> 
> 
> 
Technical Details
Message-ID: <3C3332EB.6030603@netscape.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!KWeb!dnews
References: <3c32ac06_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,19d7752252351ccc
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-01-02 08:28:26 PST
Message-ID: <3C3332EB.6030603@netscape.net>
Date: Thu, 03 Jan 2002 00:18:51 +0800
From: hugsnow Luo <Hugsnowluo@netscape.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2
X-Accept-Language: en-us
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: Question on using class TADOTable
References: <3c32ac06_2@dnews>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 61.189.188.3
X-Trace: dnews 1009988247 61.189.188.3 (2 Jan 2002 08:17:27 -0800)
Lines: 45
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!KWeb!dnews