# Re: (重复)有没有人会用vb6读取*.dbf档->不用控制项ㄛ

Posted by RamyJones on February 21, 1999 at 02:13:44:

In Reply to: (重复)有没有人会用vb6读取*.dbf档->不用控制项ㄛ posted by 问题多多 on February 20, 1999 at 23:58:30:

: (重复)有没有人会用vb6读取*.dbf档->不用控制项ㄛ
: 就是不要用到DBGRID等控制项
: 直接读取

I've done it before. Try this way:
dim db as DataBase
dim rs as Recordset

Set db = OpenDatabase("C:\Temp", False, False, "FoxPro 2.0;")
Set rs = db.OpenRecordset("Test.dbf", dbOpenTable)

rs.MoveFirst
do while not rs.EOF
print rs.Fields(1).value
print rs.Fields(2).value
rs.MoveNext
loop

Follow Ups: