Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VFP & SQL Server TimeStamps

0 views
Skip to first unread message

Richard AL Evans

unread,
Mar 20, 1997, 3:00:00 AM3/20/97
to

I had the same problem in Visual Basic. Though it would appear that you
have progressed further because I could not pass
a byte array - equivalent of VFP memo - back to a stored procedure using
RDO.

The solution I arrived at was to split the binary(8) timestamp into two
integers using the substring and convert functions and then use a
comparison of the timestamp value against these two integers - I did not
use tsequal.

James Sharier Jr. <james....@amd.com> wrote in article
<01bc2afc$e497f3a0$57d7b5a3@broomstick>...
> Hi
>
> I'm using VFP 5.0 and SQL Server 6.0.
> I'm having a problem using TimeStamps to perform optimistic locking.
> In SQL the TimeStamp is stored as a binary and is converted to a memo
> on the VFP side. I'm using a SQL stored procedure to perform updates.
> I send the procedure the values to update along with the timestamp.
> The stored procedure uses a tsequal against the timestamp sent in.
> When performing the SQLEXEC(handle, 'proc p1, p2, ..., pn, ts')
> VFP acts like the timestamp was not included and gives me an error.
> Any help is appreciated.
> TIA
> --
> _
> -------------------ooO-( )-Ooo---------------------------------
> James Sharier Jr. <>< (0 0) (512)602-5193 james....@amd.com
> ~~~
>
>
>

James Sharier Jr.

unread,
Mar 21, 1997, 3:00:00 AM3/21/97
to

Richard AL Evans <rich...@dk-uk.com> wrote in article
<01bc3535$66d67200$6521...@RICHEVAN.DK-UK.COM>...

> I had the same problem in Visual Basic. Though it would appear that you
> have progressed further because I could not pass
> a byte array - equivalent of VFP memo - back to a stored procedure using
> RDO.
>
> The solution I arrived at was to split the binary(8) timestamp into two
> integers using the substring and convert functions and then use a
> comparison of the timestamp value against these two integers - I did not
> use tsequal.

Hi Richard,

FYI, I was able to get things to work out with the help of Paul West from
Microsoft. VFP passes the TimeStamp to the Stored Procedure as
VarChar(8). So To get it to work I had to do the following
in the stored procedure :

CREATE PROCEDURE MyProc @ID Int, @MyField Char(x), @ts VarChar(8) AS
UPDATE MyTable
SET MyField = @MyField
WHERE ID = @MyID
AND TSEqual(ts, CONVERT(VarBinary(8), @ts))


Good Luck

Richard AL Evans.

unread,
Mar 22, 1997, 3:00:00 AM3/22/97
to

Thanks for the information. I will try this as soon as possible.

James Sharier Jr. <james....@amd.com> wrote in article

<01bc35fb$342c4070$57d7b5a3@broomstick>...

0 new messages