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!

Adding,Editing,Deleting, Updating Data in Fox Pro Tables. 3

Status
Not open for further replies.

fmasin

Technical User
May 3, 2002
163
0
0
GB
Hi,

I am working as a Systems Analyst and my company has just procured new software written in Fox Pro. I have got the source code for this database and would like to make some few changes. My question is when you want to delete a few records within a database...what is the best command that can allow one to do this.

Please, help me...

Kind regards,

Francis.
Francis
 
HI
The best way to begin will be to use the form designer to start with.. select the table and auto generate the form. Then run it and also see the code behind. Sooner or later you are sure to catch up with :)

ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
hi francis,

you can delete records from a table by using the DELETE command.

here's an example, with the table name as Customers and one of the field names is State, and we want to delete all records with a 'CA' as state
~~~~~~~~~~~~~~~~~~~~~~~
USE Customers
DELETE FOR State = 'CA'
~~~~~~~~~~~~~~~~~~~~~~~~
hope this helps.

 
Hi Ramani,

Many thanks indeed for you reply. However, I already have the tables ready. what I need to do is to be able to delete some records. Specifically, these records are within the Products table....I would like to be abe to delete some products that have a product code beginning with 'KS'. Which command can I use to delete them when I'm in the command editor.

Please, help.

Thank you. Francis
 
for you specific need and using the command editor, do the following...

USE Products
DELETE FOR ProductCode = 'KS'
 
Hi fxshe,

Great...thanks indeed for that help. So, do I have to say:

Use Products exclusive
Delete for Productcode ='Ks' ?

And when do I use PACK?

Thanks again. Francis
 
you are right with:

Use Products exclusive
Delete for Productcode ='Ks'

Issue the PACK command afterwards to permanently delete the records from the table.

 
HI
USE PRODUCST EXCL
DELETE ALL FOR LEFT(Productcode,2) = "KS"

If you need to drop out all these masters.. then..issue
PACK

Beware that there could be other tables which could use the products master codes and you may need to delete them all. If that is the case, make sure you are going thru all the tables before deleteing transactions in the master.

HOpe this helps you :)


ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Wow....what can I say!

Guys, thanks so much....I have been at work since morning battling to clean the database without any success. I can not believe that I can now do it in a matter of seconds! This is simply the best internet site I have come across.

Thanks again to you Ramani and Fxshe!

Francis
 
Hi,

Could someone give me a few commands for inserting a record, editing, viewing records according to certain parameters, Adding a delete Button to a form that can only allow a System Administrator to delete records and not any other user.

And how can one build a new exe file?

Thanks a lot. Francis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top