ODBC导航问题 [英] ODBC navigation problem

查看:75
本文介绍了ODBC导航问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


int counter=0;
int Field_One=0;
bool end = false
selection[0]= mpset->First_Field

mpset->MoveFirst();

While(!end)

{
if(selection[counter] >0)
    {
     Field_One++;
    }

mpset->MoveNext();
end = mpset->IsEOF();
}



以下是代码示例。它读取每条记录的第一个字段,并且应该转到下一条记录,直到完成所有记录。



大家好



我在访问我的访问数据库时遇到问题,我正在使用命令MoveFirst();和MoveNext();并使用m_pSet->检查文件结尾; IsEOF();



发生的事情是我正在运行prog而我只是反复读取第一个记录值即使EndofFile设置在记录集的末尾,运行程序。所以它是通过记录集但不承认每个记录中的值只是第一个。



我重新运行程序并进入最后一条记录。我在每条记录中都有21个字段。



有人可以帮忙吗?


Here is a sample of the code. It reads the first field of each record and should move on to next record until all records completed.

Hi all

I have a problem navigating my access DB , I am using the commands MoveFirst(); and MoveNext(); and checking for end of file with m_pSet->IsEOF();

What is happenng is I am running the prog and I am only reading the first record values repeatedly on running the program even though EndofFile gets set at the end of the recordset. So it is going through the recordset but not acknowledging the values in each record only the first.

I rerun the program and it goes to the last record. I have 21 fields in each record.

Can anybody help please ?

推荐答案

你只设置了读者的指针 - 您需要从数据中的实际位置读取数据:



可能需要添加此代码



选择[counter] = mpset-> First_Field
you only set the pointer of your reader - you need to "read" the data from the actual position in your data:

maybe this code needs to be added

selection[counter]= mpset->First_Field


这篇关于ODBC导航问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆