Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening dbase files 1

Status
Not open for further replies.

SBTBILL

Programmer
May 1, 2000
515
US
Anybody know of a way to open a dbase dbf with out turning it into a fox dbf?

Bill Couture
 
Many DBF files (not all) can be opened within Excel

Good Luck,
JRB-Bldr
 
Easy:
Code:
SET CPDIALOG OFF 
USE YourDbaseDBF

*** or
USE YourDbaseDBF SHARED IN 0

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
DO NOT do this if a memo field is involved. VFP *will* convert the memo field and alter the DBF's header to indicate it's a Fox memo field.
 
Indexs and memo are the issue any idea how to open those things?

Bill Couture
 
Hi Bill.

The best way to do this is to use the dBase ODBC driver. You can use SQL passthrough commands, create a remote view, or use a CursorAdapter. I do this all the time and it works great.

Doug
 
Bill,

Or, you could take a look at Codebase ( It lets you do just about anything with a dBASE file, including full support for indexes and memos. Not particular cheap, but it's a solid product with a long history.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Never had much luck with pass throughs, have used ADO for SQL a lot. Can you post a sample of the code?

Thanks
Bill Couture
http:\\
 
Hi Bill.

Here's some sample code off the top of my head:

lnHandle = sqlstringconnect('driver=Microsoft dBase Driver (*.dbf);dbq=C:\Location of DBF Files')
if lnHandle < 0
* handle error
return
endif
lnResult = sqlexec(lnHandle, 'select * from SomeTable where SomeClause', 'DesiredCursorName')
if lnResult = 1
* do something with the cursor
endif
sqldisconnect(lnHandle)

Doug
 
Thanks Doug I'll give it a try this weekend.

Bill Couture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top