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

How to insert data in dbf file of foxpro 2.5

Status
Not open for further replies.

Fadiikhan

Technical User
Jun 9, 2021
17
MD
Hello experts.
I have a file named mast.dbf and i want to import some more data into it from old dbf file how can i do it.
 
From title and your text I'm confused which table is old and new.

Anyway, append is available, isn't it? (As are REPLACE etc.)
Or simpyasked: What did you try yourself?

A short test with VFP9 a fox2x and a VFP (free) table:
Code:
CREATE CURSOR template(field1 C(3))
COPY TO old.dbf fox2x
COPY TO new.dbf
USE new.dbf
INSERT INTO new VALUES ('foo')
INSERT INTO old VALUES ('bar')
APPEND FROM old
BROWSE

Chriss
 
Also, it would help to know if this is a one-off requirement, that is, something you will do yourself interactively; or if you need to write a program to do it on a repeated basis.

Also, does the new DBF already exist, or do you need to create it from scratch?

If you need to create the DBF, and you are doing it interactively, one option would be to use the Import Wizard (on the Tools menu). If the DBF already exists, the easiest way is to use the APPEND FROM command. See the VFP for the full syntax.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top