Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 To: Rob Vleeschhouwer
  Where is Rob Vleeschhouwer?
 Leeuwarden
 Netherlands
 Rob Vleeschhouwer
 Tags
Subject: RE: Append blank in SQL View
Thread ID: 104590 Message ID: 104591 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, August 17, 2006 11:22:56 PM         
   


> Hi,
>
> The problem has changed. I will follow the advice from Boris and Marcia and make
> a view with an identity column. But.... in that SQL view
>
> 1. The user must be able to make new, empty records in that view. For each
> orderline at least one record.
> 2. In each new record the identity column must filled with a, lets say numeric,
> string. Increased by 1 for each new record.
>
> Also in case of changing an order it must be possible for the user to make new records.
>
>
> Is that possible? I don't think so, but who knows.
>
>
> Rob.


Yes it is.
First APPEND as many records as you want BEFORE TableUpdate the view. DO NOT touch IDENTITY field. When you want to send updates back to SQL Server do something like:
IF NOT TABLEUPDATE(1, .t., [ViewAlias])
   AERROR(laError)
   MessageBox([Update is not successful ] +laError[1,2])
ENDIF
** To get all new Identity values
** If you want to speed this up check if you have some new records
** and then requery. if you don't have new records you don't need this line
REQUERY([ViewAlias])



Borislav Borissov



ENTIRE THREAD

Append blank in SQL View Posted by Rob @ 8/17/2006 11:03:42 PM
RE: Append blank in SQL View Posted by Borislav Borissov @ 8/17/2006 11:22:56 PM
RE: Append blank in SQL View Posted by Rob @ 8/17/2006 11:54:47 PM