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

save files

Status
Not open for further replies.

armylogman

Technical User
Feb 16, 2005
34
US
I have a database with a field name UNIT_NAME and am trying to save another database with this field as the file name could someone help please

Thanks in advance

Keith
 
Not clear what you're trying to accomplish. Create a database named UNIT_NAME or create a database using the contents of the field UNIT_NAME (one or multiple tables)? Either way, is the record structure of the new table to be the same as the original database or something else (like just the UNIT_NAME field)?

A bit more detail will help posters help you.

dennis
 
I am trying to create a Database using the contents of the field named unit_name because with the data that is filtered for his unit. and save it for historical use

also is there a way to make Dbase 7.5 prompt you for where you want to save the new database.

Thanks for your help

Keith
 
Once you've got the record pointer on the correct record, then:

lcUNIT_NAME = UNIT_NAME
COPY TO (lcUNIT_NAME) FOR UNIT_NAME = lcUNIT_NAME

or

lcUNIT_NAME = UNIT_NAME
COPY TO &lcUNIT_NAME FOR UNIT_NAME = lcUNIT_NAME

I'm not familiar with Visual dBase, but these worked in earlier/similar products. These commands should yield a database table named with the contents of UNIT_NAME with the same fields as the original, filtered for the specific UNIT_NAME. If you wanted to create one database table for each unique UNIT_NAME, you'll need to create a loop/scan and execute these commands within the loop.

Not sure how to have the program prompt you for the location, though I'm sure it can be done. If the location is always the same, just different than your default directory, change the first line to :

lcUNIT_NAME = "c:\myfolder\mysubfolder\"+UNIT_NAME

substituting of course the correct drive\path information.

hth
Dennis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top