Hi RML,
The following code worked fine for me. Is it possible that your column is
not really a datetime column? Otherwise, I don't understand why you should
not be seeing the time. Are you displaying it in shortdatetime format?
strsqlselect = "select * from tblministryjoin order by todate"
Dim dam As OleDbDataAdapte r
dam = New OleDbDataAdapte r(strsqlselect, oconn)
Dim odsm As New DataSet("tblmin istryjoin")
dam.Fill(odsm, "tblministryjoi n")
Dim commandbuilder_ odsm As OleDbCommandBui lder = New
OleDbCommandBui lder(dam)
Dim irowm As DataRow
For Each irowm In odsm.Tables(0). Rows
irowm("fromdate ") = Now
MessageBox.Show (Now)
MessageBox.Show (irowm("fromdat e"))
Exit For
Next
Try
dam.Update(odsm , "tblministryjoi n")
Catch ex As Exception
MessageBox.Show (ex.Message)
End Try
HTH,
Bernie Yaeger
"RML" <RM*@discussion s.microsoft.com > wrote in message
news:3F******** *************** ***********@mic rosoft.com...
Hi everyone,
I am using VB.NET 2003 and an OleDBDataAdapte r to update an Access table's
DateTime field. The field's format is set to "General Date" (ie:
11/24/2004
8:00:00 AM). The problem is the field ends up with only a date, with no
time
component.
In my project...
I added an OleDBDataAdapte r using the wizzard to my form. I generated the
DataSet and added the desired table. I verified the field type in the
DataSet is "dateTime".
My code does this...
Me.dsTaskPro(0) .CompletedOn = Now
Me.daTaskProces s.Update(Me.dsT askPro)
The field ends up with today's date "11/24/2004", with no time component.
If I edit the field (using Access) with a date & time, say 11/24/2004
8:00:00 AM and then run my code I get a "Concurrenc y Violation" exception.
Amyone have any ideas?
Thanks RML