[color=blue]Public Sub GetSystemTimeFromServer()
Dim RS As New ADODB.Recordset
RS.Open "SELECT CONVERT(VARCHAR, GETDATE(), 108) AS T", VMASSE_CN, adOpenForwardOnly, adLockReadOnly, adCmdText
'' MUST FOUND RECORD
Time01 = RS!T
RS.Close
Set RS = Nothing
End Sub
Public Sub GetSystemDateFromServer()
Dim RS As New ADODB.Recordset
RS.Open "SELECT CONVERT(VARCHAR, GETDATE(), 112) AS D", VMASSE_CN, adOpenForwardOnly, adLockReadOnly, adCmdText
'' MUST FOUND RECORD
Date01 = RS!d
RS.Close
Set RS = Nothing
'' B.E
If LogOn_BE_CE = 1 Then
Date01 = Trim$(Val(Mid$(Date01, 1, 4)) + 543) & Mid$(Date01, 5, 4)
End If
End Sub
ช่วยแนะนำทีครับ ขอบคุณครับ
Tag : .NET, Ms SQL Server 2005, Win (Windows App), VB.NET