Groups | Blog | Home
all groups > vb.net data > march 2006 >

vb.net data : Writing dates to Access


Doug Bell
3/4/2006 12:00:00 AM
Hi,
Can anyone help me with this?
I am writing records to an Access MDB file from my VB.Net Application.
Later retrieving the data from the last 10 (say) days.
All works fine on my PC but on the Clients system it is writing the dates in
US format up to 12th of the month and then correctly writing them correctly
in International format. eg 10/2/2006 (10 Feb 2006) is written as 2/10/2006
but 13/2/2006 is written correctly as 13/2/2006.

I am saving the record by constructing an SQL string

strSQLI = "INSERT INTO tblTransactions (" & _
[GUID], ................., TransDate, .........) "

strSQL=strSQLI & "VALUES (" & _
"""" & drTrans("ID") & """," & _
.....................................................
"#" & CDate(drTrans("TransDate") & "#" & _
................................. ")"

Try

With icmdUpLdSvr

'SQL for command

..CommandText = strSQL

iProcdRecs = .ExecuteNonQuery

If iProcdRecs > 0 Then

drTrans("UpldSvr") = True

intRecsProc = intRecsProc + iProcdRecs

End If

End With

Catch ex As Exception

stError = ex.ToString

End Try

Paul Clement
3/6/2006 9:57:02 AM
[quoted text, click to view]

¤ Hi,
¤ Can anyone help me with this?
¤ I am writing records to an Access MDB file from my VB.Net Application.
¤ Later retrieving the data from the last 10 (say) days.
¤ All works fine on my PC but on the Clients system it is writing the dates in
¤ US format up to 12th of the month and then correctly writing them correctly
¤ in International format. eg 10/2/2006 (10 Feb 2006) is written as 2/10/2006
¤ but 13/2/2006 is written correctly as 13/2/2006.
¤
¤ I am saving the record by constructing an SQL string

Access will only accept dates inserted in U.S. format. Could this be the problem you are
experiencing?


Paul
~~~~
AddThis Social Bookmark Button