Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I append without opening the edit window?
Message
From
28/06/2001 10:01:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/06/2001 09:50:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00524283
Message ID:
00524671
Views:
14
>>>I want to make a copy of a record in a table and add it to the same table. I know that I can set carry on and just use the append command to do this but it opens the edit window. The only way to append without opening the edit window that I know of is to use append blank but then I have to use replace commands to fill the blank fields. How can I append without opening the edit window?
>>>
>>>Thanks in advance,
>>>Justin
>>
>>select mytable
>>scatter memvar memo
>>insert into myTable from memvar
>>
>>Beware with PKs.
>>Cetin
>
>Better yet, use the NAME clause. Adapting the example above:
>
>
>select mytable
>scatter memvar memo name loRecord
>loRecord.MyField1 = <some specific value>
>...
>append blank
>* if a PK is assigned automatically (default value) when inserting a record:
>loRecord.MyPK = MyPk
>*
>gather name loRecord
>
Hilmar,
While there are numerous ways to do this I simply couldn't get why this is 'better'. Translating yours :

select mytable
scatter memvar memo
m.MyField1 =
...
* if a PK is assigned automatically (default value) when inserting a record:
m.MyPK = MyPk
insert into myTable from memvar

Now why using name is better ? Just it's more OOP or anything else ?
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform