# Re: 请问一下，如何用VB连结*.dbf的资料?

Posted by 澳门人 on May 20, 1999 at 14:50:15:

In Reply to: 请问一下，如何用VB连结*.dbf的资料? posted by Jan on May 18, 1999 at 21:14:15:

: 如题...试着连结用VFP(6.0)建立出来的.DBF档，但不论是透过ODBC或DATA元件，都无法连结到资料..(会出现"找不到 XBase备忘档案，数目3166"的错误讯息)...
: (NT Server (sp4)平台，VB6.0企业版)...请各位帮帮忙....

这样试试吧:

if the dbf file path is "c:\dbf\abc.dbf"

dim db as database
dim rs as recordset
dim sCmd as string

set db=opendatabase("c:\dbf\abc.dbf",false,false,"foxpro 2.5;")
scmd="select * from abc order by field_name"
set rs=db.openrecordset(scmd,dbopendynaset)

with rs
code here
end with

Follow Ups:

- Re: 请问一下，如何用VB连结*.dbf的资料? Jan 15:34:52 5/20/99 (1)
  - Re: 请问一下，如何用VB连结*.dbf的资料? 澳门人 00:56:13 5/21/99 (0)