Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating remote views
Message
From
08/09/1998 04:59:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00133969
Message ID:
00133970
Views:
9
>Hi All,
>
>I have a problem updating remote views. Here is some code to reproduce my problem. I create a Remote view (tmpView) on a Free foxpro table (tmpTable) through a Foxpro ODBC datasource (tmpconnection)
>
>CREATE DATABASE tmpDBC
>CREATE SQL VIEW tmpView REMOTE CONNECTION 'tmpConnection' ;
> AS SELECT * FROM tmpTable
>
>USE tmpView
>lnFields = AFIELDS(laFields)
>FOR lnTeller = 1 TO lnFields
> lcField = 'tmpView.' + laFields[lnTeller,1]
> IF laFields[lnTeller, 2] $ 'DT'
> *!* Empty data(time) fields result in {30-12-1899}
> *!* instead of empty fields, so replace
> REPLACE ALL (laFields[lnTeller,1]) WITH { } ;
> FOR EVAL(laFields[lnTeller,1]) = {30-12-1899}
> ENDIF
> IF PCOUNT() > 1 AND laFields[lnTeller,1] $ UPPER(tcIndex)
> DBSETPROP(lcField, 'Field', 'KeyField', .T.)
> ENDIF
>ENDFOR
>
>FOR lnTeller = 1 TO lnFields
> lcField = 'tmpView.' + laFields[lnTeller,1]
> DBSETPROP(lcField, 'Field', 'Updatable', .T.)
>ENDFOR
>DBSETPROP('tmpView', 'View', 'SendUpdates', .T.)
>CURSORSETPROP('Buffering', 5, 'tmpView')
>
>When I change something in this view an do an TABLEUPDATE() nothing changes in the original table. My tmpTable is in my c:\temp directory and the tmpConnection DSN points to that directory. Now I do the following:
>
>REPLACE ALL nRecID WITH RECNO()
>TABLEUPDATE(0, .T., 'tmpView')
>CLEAR ALL
>USE C:\TEMP\tmpTable
>BROWSE
>
>While TABLEUPDATE did return .T. the original table still shows the old values. What could be wrong here?
Being frankly, seeing tableupdate(0...) after replace all I didn't check the rest. tableupdate(0) would tableupdate current rec and after replace all you're at eof(). use tableupdate(1 or 2) instead.
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