🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.database
Article #895

Re: 请教关于ADO连接的问题

#895
From: 无为
Date: Sun, 13 Jul 2008 23:40
23 lines
2969 bytes
On 7月11日, 上午12时07分, Dem....@bbs.sjtu.edu.cn (Galaxy·VOLUNTEERS) wrote:
> 先google吧
> 随便找到篇:http://support.microsoft.com/kb/294160/en-us
> 【 在 aihenry (Nash~~惟楚有才) 的大作中提到: 】
> : 在VS2005里面C++工程里面,用ADO连接Access2000的一个.mdb文件
> : 读取内容的时候recordset->movefirst();  然后recordset->movenext();
> : 就这样一共30行全都读出来了。
> : 但是往.mdb文件写信息的时候,也是先recordset->movefirst();
> : 然后每写好一行就recordset->movenext();
> : 但是movenext只搞了三次就出error了。
> : 错误叫 DB_E_ERRORSOCCURRED
> : 就是调用movenext时出现的
> : 我就很奇怪,因为这个表里有30行,才走了三行不应该到头了啊。
> : 后来我就干脆每次都movefirst 然后move(i)   每次i++
> : .................(以下省略)
>
> --
> I thought what I'd do was, I'd pretend I was one of those deaf-mutes
> Or should I?
>
> You know what I'd like to be? I mean if I had my goddam choice, I'd just be
> the catcher in the rye and all.
>
>  [m [1;32m※ 来源:·饮水思源 bbs.sjtu.edu.cn·[FROM: 58.35.147.204] [m

然后每写好一行就recordset->movenext();
你境加了,后后post 后,数据指针应该已经指向最后一条记录了吧(刚新增的哪条记录)
所以三次就出错正常拉!
.............................................................................
http://cndba.5d6d.com 中国数据库联盟
Technical Details
Message-ID: <ab311430-12fc-44b1-bda6-e335a396c38b@f63g2000hsf.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!f63g2000hsf.googlegroups.com!not-for-mail
References: <4b0Y92$aec@bbs.sjtu.edu.cn>

Show Full Headers
Complete Article Headers
X-Google-Thread: 101948,7a2aa97663899d23
X-Google-Attributes: gid101948,domainid0,public,usenet
X-Google-Language: Chinese,GB
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!f63g2000hsf.googlegroups.com!not-for-mail
From: 无为 <chinamis2008@gmail.com>
Newsgroups: cn.bbs.comp.database
Subject: Re: 请教关于ADO连接的问题
Date: Sun, 13 Jul 2008 16:40:55 -0700 (PDT)
Organization: http://groups.google.com
Lines: 23
Message-ID: <ab311430-12fc-44b1-bda6-e335a396c38b@f63g2000hsf.googlegroups.com>
References: <4b0Y92$aec@bbs.sjtu.edu.cn>
NNTP-Posting-Host: 116.25.13.94
Mime-Version: 1.0
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: base64
X-Trace: posting.google.com 1215992456 23220 127.0.0.1 (13 Jul 2008 23:40:56 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 13 Jul 2008 23:40:56 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: f63g2000hsf.googlegroups.com; posting-host=116.25.13.94; 
 posting-account=GrR-aQoAAADfmb8MH8OKFKYJzgbuqV9A
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 
 2.0.50727; CIBA),gzip(gfe),gzip(gfe)