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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing Files in a database

Status
Not open for further replies.
Apr 19, 2005
13
US
Is there a way to store files in a foxpro database? Such as pdf, excel etc?

Thanks

Ross
 
Create a binary memo field in your table. Let's call the field MyFiles for this example...

To save your file...

APPEND MEMO MyFiles FROM ("C:\Temp\MyXLS.xls") Overwrite

To copy your file back out at some later date...

Copy Memo MyFiles to ("C:\Temp\MyXLS.xls")


boyd.gif

 
Is there a way to store files in a foxpro database? Such as pdf, excel etc?

Just to clarify matters. A foxpro database is a reference to a number of tables held in dbf files and can't hold a pdf.

A memo field in a table can hold the contents of any sort of file.

A general field in a table can hold an OLE object. You can store an Excel file as an object of type Excel but AFAIK you can't hold an object of type pdf (at least not on my PC).

All of which leads to the question of why do you want to store the file in a table? The table will be very large and will bloat each time the file changes. Why not just store the file path and name?

Geoff Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top