Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tableupdate
Message
 
 
À
26/02/2001 07:52:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00479334
Message ID:
00479455
Vues:
28
Thanks Marcia:
When I do the TABLEUPDATE (only when buffering 5 - table optimistic). I'm getting the error 1526 - ODBC Visual FoxPro Driver Connectivity error.
Anyway I would like to select some records from the buffered modified view without updating it to the main table (just for a report) but I'm not able to do it either cause any time I use the select it goes back to the original view.
Thank you

>Hello Eduardo.
>
>>> - when I try to select records from that view
> SELECT * FROM x WHERE (new replacements) INTO CURSOR x
> it does not recognize the new replacements <<
>
>This is what I would expect to happen. SQL SELECT operates on the file on disk and not on the changes in the buffer. You must commit the changes using TABLEUPDATE in order for the SQL to "see" them
>
>>> - when I write TABLEUPDATE(1,.T.), always fails <<
>
>TABLEUPDATE is a function that returns a value. You need to use code like this to find out why it is failing:
>
>
>
>IF NOT TABLEUPDATE( 1, .T., '< MyAlias >' )
>   IF NOT This.HandleError()
>   RETURN .F.
>ENDIF
>
>
>HandleError method looks like this:
>
>
>LOCAL laErrors[1], llRetVal, loUpd, lnMsgNo
>llretVal = .T.
>
>AERROR( laErrors )
>DO CASE
>CASE laErrors[1] = 1539		&& Trigger failed
>  DO CASE
>    CASE laErrors[5] = 1	&& Insert Trigger
>	MESSAGEBOX( 'Insert Trigger Failed', 16, 'Unable to Insert Record' )
>	llRetVal = .F.
>    CASE laErrors[5] = 2	&& Update Trigger
>	MESSAGEBOX( 'Update Trigger Failed', 16, 'Unable to Update Record' )
>	llRetVal = .F.
>    CASE laErrors[5] = 3	&& Delete Trigger
>	MESSAGEBOX( 'Delete Trigger Failed', 16, 'Unable to Delete Record' )
>	llRetVal = .F.
>  ENDCASE	
>CASE laErrors[1] = 1585		&& Update Conflict
>  *** Instantiate the custom form class that displays any unresolvables
>  *** Update conflicts and lets the user resolve them
>  loUpd = CREATEOBJECT( 'updres', ThisForm.DataSessionID, .cPrimaryTable )
>  IF TYPE( 'loUpd' ) = "O" AND ! ISNULL( loUpd )
>    loUpd.Show()
>  ENDIF
>  llRetVal = .T.
>CASE laErrors[1] = 1884		&& Duplicate key	
>  MESSAGEBOX( 'Duplicate Key', 16, 'Unable to Save Record' )
>  llRetVal = .F.
>OTHERWISE
>  MESSAGEBOX( 'Unknown Problem', 16, 'Unable to Save Record' )
>  llRetVal = .F.
>ENDCASE							
>RETURN llRetVal				
>
>
>Marcia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform