Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Tableupdate with remote view not working
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00592857
Message ID:
00592931
Views:
27
Terrific! Keep in mind in the FOR loop, I skip a field called KEYID, this is the field name of my PK. So you probably figured out to skip your PK field and change that field name to whatever your PK field is. Also make sure you set the WhereType and UpdateType to what you want. Sorry for the oversite.

>You just saved my life. It works. I'd kiss you, but it's too long a reach.
>
>Thanks loads,
>
>JR
>
>>Here is my sample code that I use to make a cursor updatable:
>>PROC MakeUpdatable
>>   LPARAMETERS tcCursor, tcTable
>>   IF VARTYPE(tcCursor) <> 'C'
>>      RETURN .f.
>>   ENDIF
>>   IF VARTYPE(tcTable) <> 'C'
>>      RETURN .f.
>>   ENDIF
>>   IF NOT USED(tcCursor)
>>      RETURN .f.
>>   ENDIF
>>   SELECT (tcCursor)
>>   CURSORSETPROP('Tables', tcTable)
>>   ** The next property must include every remote field matched with the
>>   ** view cursor field.
>>   LOCAL lcFields, lcUpdate, llRetVal
>>   lcFields = ''
>>   lcUpdate = ''
>>   FOR lnI = 1 TO FCOUNT(tcCursor)
>>      IF NOT EMPTY(lcFields)
>>         lcFields = lcFields + ', '
>>      ENDIF
>>      lcFields = lcFields + FIELD(lnI, tcCursor) ;
>>               + ' ' + tcTable + '.' + FIELD(lnI, tcCursor)
>>      IF UPPER(FIELD(lnI, tcCursor)) == 'KEYID'
>>         LOOP
>>      ENDIF
>>      IF NOT EMPTY(lcUpdate)
>>         lcUpdate = lcUpdate + ', '
>>      ENDIF
>>      lcUpdate = lcUpdate + FIELD(lnI, tcCursor)
>>   ENDFOR
>>   llRetVal = CURSORSETPROP('UpdateNameList', lcFields, tcCursor)
>>   llRetVal = CURSORSETPROP('KeyFieldList', 'KeyID', tcCursor)
>>   ** The next property specifies which fields can be updated.
>>   llRetVal = CURSORSETPROP('UpdatableFieldList', lcUpdate, tcCursor)
>>   ** The next property enables you to send updates.
>>   llRetVal = CURSORSETPROP('SendUpdates', .T., tcCursor)
>>   llRetVal = CURSORSETPROP('UpdateType', 1, tcCursor)
>>   llRetVal = CURSORSETPROP('WhereType', 3, tcCursor)
>>ENDPROC
>>
>>>It says "No update tables are specified. Use the Tables property of the cursor." But as I'm sure you've noticed by the code below, I do have
>>>>>>>=CURSORSETPROP('Tables','fromts2')
>>>in there.
>>>
>>>Eeps.
>>>
>>>JR
>>>
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform