T
Tomas Andersson
I have a Sub with the following code
Public Sub Logg(ByVal Lvl, ByVal Designation, ByVal Uid, ByVal FileString,
ByVal ImportMode)
Dim AA As MySqlConnection = New MySqlConnection("server=" & MYSQLServer &
";database=" & MYSQLDB & ";uid=" & MYSQLUser & ";pwd=" & MYSQLPassword & "")
AA.Open()
Dim cmd As MySqlCommand = New MySqlCommand()
cmd.Connection = AA
cmd.CommandText = "INSERT INTO
spmon_log(DateNTime,Lvl,Designation,Uid,FileString,ImportMode) VALUES ('" &
Now().ToString & "','" & Lvl & "','" & Designation & "','" & Uid & "','" &
FileString & "','" & ImportMode & "') ON DUPLICATE KEY UPDATE
ID=LAST_INSERT_ID(ID)"
Dim DR As MySqlDataReader = cmd.ExecuteReader
DR.Close()
AA.Close()
AA = Nothing
End Sub
o
Trubble is that if I run this code in my worstation a correct datetime is
registered in the database 2009-04-17 08:21:22
But this code is a part of a service running on a Server 2003 R2 and the
result is 0000-00-00 00:00:00
What can i do to correct this?
Public Sub Logg(ByVal Lvl, ByVal Designation, ByVal Uid, ByVal FileString,
ByVal ImportMode)
Dim AA As MySqlConnection = New MySqlConnection("server=" & MYSQLServer &
";database=" & MYSQLDB & ";uid=" & MYSQLUser & ";pwd=" & MYSQLPassword & "")
AA.Open()
Dim cmd As MySqlCommand = New MySqlCommand()
cmd.Connection = AA
cmd.CommandText = "INSERT INTO
spmon_log(DateNTime,Lvl,Designation,Uid,FileString,ImportMode) VALUES ('" &
Now().ToString & "','" & Lvl & "','" & Designation & "','" & Uid & "','" &
FileString & "','" & ImportMode & "') ON DUPLICATE KEY UPDATE
ID=LAST_INSERT_ID(ID)"
Dim DR As MySqlDataReader = cmd.ExecuteReader
DR.Close()
AA.Close()
AA = Nothing
End Sub
o
Trubble is that if I run this code in my worstation a correct datetime is
registered in the database 2009-04-17 08:21:22
But this code is a part of a service running on a Server 2003 R2 and the
result is 0000-00-00 00:00:00
What can i do to correct this?