SqlTsPut%

Puts the new value of the timestamp column into a specified table's current row in the row buffer.

Syntax

SqlTsPut% ( sqlconn%, newts$, newtslen%, tabnum%, tabname$ )

where

sqlconn%
Is a SQL Server connection. The value of sqlconn% is returned by SqlOpen%.
newts$
Is the new timestamp value. The new timestamp value is returned by SqlTsNewVal$.
newtslen%
Is the length of the new timestamp value. It is returned by SqlTsNewLen%.
tabnum%
Is the number of the table to receive the new timestamp. Table numbers start at 1. The tabnum% parameter must refer to a browsable table. Use SqlTabBrowse% to determine whether the table you specify can be browsed. If the table is browsable, tabname$ is used to identify the table.
tabname$
Is a string containing the table name. The tabname$ parameter must refer to a browsable table. If the string is empty, tabnum$ is used to identify the table. The value of tabname$ is returned by SqlTabSource$.

Returns

SUCCEED (1) or FAIL (0). The following conditions cause SqlTsPut% to return FAIL:

Remarks

SqlTsPut% is a DB-Library for Visual Basic browse-mode function. For a detailed discussion of browse mode, see DB-Library for Visual Basic Programming.

SqlTsPut% manipulates the timestamp column. When used in an UPDATE statement, the WHERE clause returned by SqlQual$ places a new value in the updated row's timestamp column and returns the new timestamp value to the application (if the update is successful). If the same row is updated a second time, the UPDATE statement's WHERE clause must use the latest timestamp value. SqlTsPut% updates the timestamp in the row currently being browsed. Then, if the application has to update the row a second time, it calls SqlQual$ to formulate a new WHERE clause that uses the new timestamp. With SqlTsNewVal$, the application saves a new timestamp value, possibly for use with SqlTsPut%. Call SqlTsPut% only after SqlNextRow% or SqlGetRow% has returned regrow.

See Also

SqlColBrowse%, SqlColSource$, SqlQual$, SqlTabBrowse%, SqlTabCount%, SqlTabName$, SqlTabSource$, SqlTsNewLen%, SqlTsNewVal$