Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter SQL Server and Identity column
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01526084
Message ID:
01526136
Views:
40
>>>>Hi,
>>>>
>>>>I am using CursorAdapter method of updating base table in SQL Server from VFP application. One of the columns is identity column. Typically user has not access to this column so when the base table in SQL is updated, there is no problem. But I have a process that can enter a value into the Identity column (usually 0) of the CursorAdapter. In this case, before I call TABLEUPDATE() I would like to "disable" cursor adapter from trying to set the value in the base table. Otherwise, there is an error. Is there a method/approach of programmatically "instruct" CursorAdapter not to try updating the Identity column?
>>>>
>>>>TIA.
>>>
>>>You have to remove this column from UpdatableNameList property.
>>
>>You are correct. However, I use the same application with the same BIZ object based on Cursor Adapter for either SQL Server or VFP data. For VFP data I need to be able to update the "Identity" column; for SQL Server not. For now I found the solution to this dilemma. But in the future I will probably change my code to exclude this column from the UpdatableNameList if the application is using SQL Server.
>>Thank you.
>
>Make VFP column also to be IDENITY (or AUTOINC in VFP):-)

I thought about this. But my VFP application has so many dependencies on "my way" of assigning the value to "Identity" column that something for sure will break. So I decided to keep my code as is. Eventually - this is my goal - I won't even support VFP data but only SQL Server database. I will still use VFP 9 application but the data will be SQL Server. So the issue of VFP Identity field will be moot.
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform