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

Posted by Jan on May 20, 1999 at 15:34:52:

In Reply to: Re: 请问一下，如何用VB连结*.dbf的资料? posted by 澳门人 on May 20, 1999 at 14:50: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

谢谢您的回答，可是若是Client/Server 架构，且需用到多张table时，此法似乎...

Follow Ups:

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