Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending data from one table to another without overwri
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00562372
Message ID:
00562379
Views:
32
>Hello everyone,
>This is my first time writing to this forum and I am very happy to have found this resource! I need some help with the syntax for a program I am working on.
>I have a grid that pulls records from "tableA" and would like to have the information that is updated on the grid inserted into another table "tableB" without overwriting existing records from "tableA". I have tried using "Append from" in the SQL but Fox Pro won't accept it. How can this be performed?
>
>Here's the SQL I use:
>SELECT * ;
> APPEND FROM tableA;
> ORDER BY tableA.fieldA;
> INTO TABLE tableB
>
>Also how can I have messages automatically responed to? For example when a message box appears with yes or no response buttons how can I make it automatically select "yes" so the process is not stopped and no user input is required? The return value should be 6 but how do I implement code to make the form choose it?

The default button on MessageBox() is set with the 2nd parameter. The default selected button is the 1st one. To make button 2 or 3 the default, pass 256 or 512 respectively. This number is in addition to the numeric value that chooses the icon and which buttons are offered. I'm looking at the VFP7 docs, which describe this in detail. I think the VFP6 and prior docs also contain this info.

If you are using VFP7, MessageBox() supports a timeout parameter (4th parameter). If user makes no selection before the timeout, MessageBox() returns -1. The file FoxPro.h contains constant definitions for MessageBox return values, button selections, etc. I recommend using these to make your code easier to read in the future. Put #INCLUDE FoxPro.h at the top of your program file(s) to reference these constants. When using forms and visually-designed classes (VCX, SCX), there's an option on the menu system to designate a single INCLUDE file for the class/form.

liAnswer = MESSAGEBOX("Please choose...", ;
MB_YESNOCANCEL + MB_ICONQUESTION + MB_DEFBUTTON2

If you are using VFP6 or earlier, check the files section here on UT for code that works around the lack of a timeout parameter. Try searching on MESSAGEBOX. I think there are multiple code examples found there.

Best of luck, and don't hesitate to post questions here. There are lots of people on UT who can and will help!


>
>Thanks in advance for your help!
>Max
"Problems cannot be solved at the same level of awareness that created them." - Albert Einstein

Bruce Allen
NTX Data
Previous
Reply
Map
View

Click here to load this message in the networking platform