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!

Copying Tables ,Deleting Records 2

Status
Not open for further replies.

EKC

Technical User
Jan 13, 2001
43
CA
Hi,
Here I come again.I have 3 questions:

1.We have VFP database with a interface.Because we needed a new report,I made program that make that new report(few select statement and then openning Excel and running macro to manipulate those data).The problem was with linking to database tables.Because of access right set in code ,the only choice I had was to copy the tables I needed to new location and link those tables to my program.So first thing my program do is delete old .dbf,.cdx,.fpt (on my location) files and then copy new one to my location.It works fine -I always have the newest data that users are entering through interface.My question: is this OK- copying tables and indexes?Can it have some consequences?

2.As I said users are entering new data using interface.Strange thing is that when they delete a record ,so you can't see it through interface ,my program still have it .Why is this?Because I'm coming from Access I know that in Access records are only marked as deleted but are deleted when you compact the database.Is this case in VFP and what I can do to remove those deleted records from my report.

3.Last question:Is there a way to send e-mail from my program to a person if program was interupted for any reason.(We want to run this program automatically early in the morning when nobody is around.I don't have any error handeling code in my program

Any help appreciated.
Lyn
 
Hi my friend

Q1...
If I were you I wouldn't copy all the files and indexes, istead I would contact my database admin to give me a valid access to the database or whatever make me able to access the live database. Sure it is doable.
The only consequences you sould worry about [In case you just retreve data, NO UPDATE] is adding unnessacery overheads to your code.

Q2- Read SET DELETE on the help

Q3- Yes you can send E-mail from FoxPro code..
Locate the Classlibrary _Miscbtns.vcx in your computer
Modify the Class _Mailbtn inside this Classlibrary
Read the Click method to understand how it works.
SubClass or modify whatever you see fit.
If you using Outlook in the computer will send this message you can take a shortcut by using this code.
Code:
myOlApp=CREATEOBJECT("OUTLOOK.APPLICATION")
myMessage=myOlApp.CREATEITEM(0)
myMessage.TO="Engwam@Hotmail.com"
myMessage.Subject="Hi my friend"
myMessage.cc="some_Address@Some_Domain.com"
myMessage.bcc="some_Address@Some_Domain.com"
myMessage.Body="This is test"
myMessage.Send()
Hope this will help you, good luck Walid Magd
Engwam@Hotmail.com
 
Our local FoxPro user's group, El Zorro, has been playing around a bit with Outlook and I was told we need to put in a line like

Code:
 MyNameSpace = MyOlApp.GetNamespace("MAPI")

after you create the MyOlApp. Is that the case here too, or can it be skipped, and if so why?

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top