Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TableUpdate sees old records as new
Message
De
10/11/2009 09:01:18
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01433973
Message ID:
01434000
Vues:
51
Thanks Sergey. I will try it and let U know.
btw. From the first look , it seems to me that it assigns properties as in a CursorAdapter. The problem I have is to INFORM the parent table that the records are not NEW. Is there such a property in cursoradupter?

>See file #8153 How to make SQL Pass-Through cursor updatable
>
>>server mssql 2008
>>*STEP1 in the load procedure I create the cursor: cList
>>SQLEXEC(lnhandle, [select * from table1 where 0=1],[clist])
>>
>>*STEP2 in other pocedures the users retrieves data from table1 (same table that the cList is created)
>>SQLEXEC(lnhandle, [select * from table1 where somecriteria_1],[cTemp])
>>INSERT INTO cList SELECT * FROM cTemp
>>
>>SQLEXEC(lnhandle, [select * from table1 where somecriteria_2],[cTemp])
>>INSERT INTO cList SELECT * FROM cTemp
>>......................................
>>SQLEXEC(lnhandle, [select * from table1 where somecriteria_50],[cTemp])
>>INSERT INTO cList SELECT * FROM cTemp
>>
>>*STEP3 the user changes some values in the cursor Clist (records are displayed in a grid)
>>
>>*STEP4 save changes
>>SELECT cList
>>SCAN
>> lid=cList.table1_id
>> SQLEXEC(nhandle,[update table1 set fld1=newval1,fld2=newval2, fld3=newval3 where table1_id=lid])
>>ENDSCAN
>>The above code works fine.
>>
>>The question: is it posible to avoid the scanning and update the data with: Tableupdate(.t., .t., 'cList')
>>When i try the tableupdate function I receive the error of uniq key violation.
>>The server sees the records in the cLIst as new records.
>>The same problem occurs and in the case that I create the cList cursor with the CursorAdapter method.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform