Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Making SQL Pass-Through Cursor Updatable
Message
De
04/03/2003 16:30:55
 
 
À
04/03/2003 14:58:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00760620
Message ID:
00761208
Vues:
38
Monique,

Did you add CURSORSETPROP("SendUpdates", .t.) as suggested by Claudio? Other than that, I don't see anything strange.

One thing that you could do is compare the properties of the remote view which works with the properties of the SPT cursor to see what's different. Here's some code that I use for this purpose:
SELECT RemoteView
ShowCursorProp("c:\temp\rv.txt")

SELECT SptCursor
ShowCursorProp("c:\temp\spt.txt")


   ************************************************
   PROCEDURE ShowCursorProp
   ************************************************
   *  Author............: Daniel Gramunt
   *) Description.......: Writes the values of CURSORGETPROP() of the currently selected
   *)                   : table/cursor to < tcFile >. Handy for debugging.
   *  Calling Samples...:
   *  Parameter List....: tcFile  - Path\filename to which the properties are written.
   *                    : [tnSql] - Optional. SQL connection handle.
   *                    :           If omitted, uses This.inSql
   *  Major change list.:
   *--------------------------------------------------------------------------------------------------
   LPARAMETERS tcFile

   ASSERT VARTYPE(tcFile) = "C" AND NOT EMPTY(tcFile);
          MESSAGE "Parameter < tcFile > : Parameter missing or wrong type (Expecting 'C')"
      
   LOCAL lnSourceType
      
   *-- make sure cursor/table is selected
   IF EMPTY(ALIAS())
      *-- No cursor/table selected. Inform user and bail out.
      This.MessageBox("No table is open in the current work area.",;
                      MB_ICONEXCLAMATION,;
                      This.icMessageBoxCaption)
      RETURN -1
   ENDIF
    
   lnSourceType = CURSORGETPROP("SourceType")
  
   SET TEXTMERGE TO (tcFile)
   SET TEXTMERGE ON NOSHOW
   \Generated at <<DATE()>> <<TIME()>>
   \
   \Table = <<ALIAS()>>
   \DBF   = <<DBF()>>
   \
   \CursorGetProp()
   \
   DO CASE
      CASE lnSourceType = 1 && local view
              \Local View      
              \BatchUpdateCount   = <<CURSORGETPROP("BatchUpdateCount")>>
              \Buffering          = <<CURSORGETPROP("Buffering")>>
              \CompareMemo        = <<CURSORGETPROP("CompareMemo")>>
              \Database           = <<CURSORGETPROP("Database")>>
              \FetchAsNeeded      = <<CURSORGETPROP("FetchAsNeeded")>>
              \FetchMemo          = <<CURSORGETPROP("FetchMemo")>>
              \FetchSize          = <<CURSORGETPROP("FetchSize")>>
              \KeyFieldList       = <<CURSORGETPROP("KeyFieldList")>>
              \MaxRecords         = <<CURSORGETPROP("MaxRecords")>>
              \Prepared           = <<CURSORGETPROP("Prepared")>>
              \SendUpdates        = <<CURSORGETPROP("SendUpdates")>>
              \SourceName         = <<CURSORGETPROP("SourceName")>>
              \SourceType         = <<CURSORGETPROP("SourceType")>>
              \SQL                = <<CURSORGETPROP("SQL")>>
              \Tables             = <<CURSORGETPROP("Tables")>>
              \UpdatableFieldList = <<CURSORGETPROP("UpdatableFieldList")>>
              \UpdateNameList     = <<CURSORGETPROP("UpdateNameList")>>
              \UpdateType         = <<CURSORGETPROP("UpdateType")>>
              \UseMemoSize        = <<CURSORGETPROP("UseMemoSize")>>
              \WhereType          = <<CURSORGETPROP("WhereType")>>
      CASE lnSourceType = 2
              \Remote View
              \BatchUpdateCount   = <<CURSORGETPROP("BatchUpdateCount")>>
              \Buffering          = <<CURSORGETPROP("Buffering")>>
              \CompareMemo        = <<CURSORGETPROP("CompareMemo")>>
              \ConnectHandle      = <<CURSORGETPROP("ConnectHandle")>>
              \ConnectName        = <<CURSORGETPROP("ConnectName")>>
              \Database           = <<CURSORGETPROP("Database")>>
              \FetchAsNeeded      = <<CURSORGETPROP("FetchAsNeeded")>>
              \FetchMemo          = <<CURSORGETPROP("FetchMemo")>>
              \FetchSize          = <<CURSORGETPROP("FetchSize")>>
              \KeyFieldList       = <<CURSORGETPROP("KeyFieldList")>>
              \MaxRecords         = <<CURSORGETPROP("MaxRecords")>>
              \Prepared           = <<CURSORGETPROP("Prepared")>>
              \SendUpdates        = <<CURSORGETPROP("SendUpdates")>>
              \SourceName         = <<CURSORGETPROP("SourceName")>>
              \SourceType         = <<CURSORGETPROP("SourceType")>>
              \SQL                = <<CURSORGETPROP("SQL")>>
              \Tables             = <<CURSORGETPROP("Tables")>>
              \UpdatableFieldList = <<CURSORGETPROP("UpdatableFieldList")>>
              \UpdateNameList     = <<CURSORGETPROP("UpdateNameList")>>
              \UpdateType         = <<CURSORGETPROP("UpdateType")>>
              \UseMemoSize        = <<CURSORGETPROP("UseMemoSize")>>
              \WhereType          = <<CURSORGETPROP("WhereType")>>
      CASE lnSourceType = 3
              \Table/Cursor
              \Buffering          = <<CURSORGETPROP("Buffering")>>
              \Database           = <<CURSORGETPROP("Database")>>
              \KeyFieldList       = <<CURSORGETPROP("KeyFieldList")>>
              \SourceName         = <<CURSORGETPROP("SourceName")>>
              \SourceType         = <<CURSORGETPROP("SourceType")>>
   ENDCASE
   SET TEXTMERGE OFF 
   SET TEXTMERGE TO
   
   MODIFY COMMAND (tcFile) NOEDIT   
   *-- EOF Method ShowSqlProp -------------------------------------------------------------------------------
HTH

>Hi,
>
>Thanks for your reply. SetUpdate() is the code from FAQ#8153. This code did not work for me. I also downloaded and tried the SPT class FAQ#15131. When I requeried the data was the same. The changes never save.
>
>If I create a view to the data and change it, it sticks.
>
>Any other ideas what might be causing this? It's horrible to be stuck on such an elementary thing.
>
>Thanks,
>Monique
Daniel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform