Note: I assume the all your data tables has these two or three fields
User_Name - the one who transact the data
DateEncoded/Modified - the transaction date base on user's local time.
Computer Name - Optional, it use to trace the users location.
If it's not added to your data table, please do apply the fields it may help you trace your transactions.
'------ VB Code ----------
'Declaration
Dim Const mCon="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Mydatabase;Data Source=MyComputerName\SQLEXPRESS"
'Note : Change the Mydatabase to your Database Name
' MyComputerNmae = Your Database Server Name
Private Sub Form_Load()
Call SynChronize_Date_Server()
Function SynChronize_Date_Server()End Sub
On Error Resume Next
Dim tmp1 As Date
With Main.ado1 ' Add adodc1 object to the form and name it ado1
.ConnectionString = mCon
.CommandType = adCmdStoredProc
.RecordSource = "sp_getserverdate;1"
.Refresh
Date = Format(.Recordset!ServerDate, "mm/dd/yy")
Time = Format(.Recordset!ServerDate, "hh:mm:ss")
End With
End Function
Function Get_Server_Date() As Date
On Error Resume Next
Dim tmp1 As Date
With Main.ado1
.ConnectionString = mCon
.CommandType = adCmdStoredProc
.RecordSource = "sp_getserverdate;1"
.Refresh
Get_Server_Date = Format(.Recordset!ServerDate, "mm/dd/yy")
End With
End Function
'-------------------------------- STORED PROCEDURED CODE ----------------------------
USE [Inventry]
GO
/****** Object: StoredProcedure [dbo].[sp_getserverdate]
Script Date: 04/20/2010 01:19:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[sp_getserverdate]
as
set nocount on
select getdate() as ServerDate
10 comments:
This post gives you method to synchronize date/time from a SQL server. The method is easy to implement. You can get the output with a simple query. This information is very useful. I like your work. Thanks for the post.
Interesting post. Keep posting such kind of information on your blog. I bookmarked it for continuous visit.
I don’t skills need to I offer you with thanks! i am altogether appalled by your article. You saved my time. Thanks 1,000,000 for sharing this text.
Interesting stuff to read and useful to improve knowledge.
Keep posting.
Biotech Internships | internships for cse students | web designing course in chennai | it internships | electrical engineering internships | internship for bcom students | python training in chennai | web development internship | internship for bba students | internship for 1st year engineering students
manisa
sakarya
sivas
van
elazığ
DD4P3
https://titandijital.com.tr/
balıkesir parça eşya taşıma
eskişehir parça eşya taşıma
ardahan parça eşya taşıma
muş parça eşya taşıma
RE7D
kocaeli evden eve nakliyat
kilis evden eve nakliyat
bursa evden eve nakliyat
trabzon evden eve nakliyat
hakkari evden eve nakliyat
XYBVC
76DDA
Malatya Parça Eşya Taşıma
Kırşehir Lojistik
İzmir Evden Eve Nakliyat
Edirne Parça Eşya Taşıma
Niğde Evden Eve Nakliyat
6C879
sakarya sesli sohbet siteleri
sesli sohbet siteleri
karabük kadınlarla rastgele sohbet
kırıkkale canlı sohbet ücretsiz
canlı sohbet siteleri ücretsiz
bolu canlı sohbet uygulamaları
adıyaman canlı sohbet odası
kadınlarla görüntülü sohbet
kütahya görüntülü sohbet kızlarla
A very awesome blog post. We are really grateful for your blog post.
Akurdupoetry
Post a Comment