📄 11413.html
字号:
<html>
<head>
<title>TimeStamp不是这样用</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>TimeStamp不是这样用</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by <a href="mailto:cww5@mail.ncku.edu.tw">cww</a> on March 27, 1999 at 11:25:34:<p>
In Reply to: <a href="11405.html">Problem using "timestamp" for concurrency control</a> posted by Richard Pang on March 27, 1999 at 00:18:55:<p>
: I link Visual Basic 5 with MS SQL Server 6.5. My problem is that I cannot retrieve and store "timestamp" field from table in MS SQL Server. My purpose is to store value of timestamp when editing and to compare the current and stored values so that I know whether this recordset is updated by other people or not during my editing.<p>1.TimeStamp在vb可能没有哪个资料型态与之对应,除了<br>Variant 或Byte(),它是8个Byte的资料<br>2.就算真的用以下的方式可做<br>checktime = data1.recordset("timestamp")<br>.<br>.<br>If checktime = data1.recordset("timestamp")<br>那这条件句也一定会相同,因为资料您早就抓到Client端了,<br>除非Rehresh资料,要不然二者一定相同<br>所以,应是去Update它,而后再看看Update有没有产<br>生冲突,若有再来重新Update一次。<br>TimeStamp是Sql Server内部查询资料有没有被更新<br>过的判断依据,不是我们程式设计者能去控制的<p><br>: 'To compare the up-to-date timestamp with the one previous retrieved<br>: 'However, datatype mismatch. I don't know how to resolve<br>: data1.recordset.update<br>: msgbox "Successfully updated!"<br>: Else<br>: msgbox "Someone have changed your record during editing. Update abort.<br>: end if<br>: end sub<p>: MS SQL Server table:<br>: create table apart_pict(<br>: id int IDENTITY (1,1) NOT NULL,<br>: apart_id char(8) NULL,<br>: timestamp NULL,<br>: primary key(id))<p>: Would anyone solve my problem? I can't retrieve data through dao and I can't do comparision.<p>: <br>: Thank you for your help<br>: Richard<p>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 11413-->
</ul><!--end: 11413-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -