update DATE error....?
-
It depends on what database you are using.
Mike Lasseter
-
For using dates in access you will need to use # around the date instead of '. Example: #8/23/06#
Mike Lasseter
-
For using dates in access you will need to use # around the date instead of '. Example: #8/23/06#
Mike Lasseter
-
not working here coding: ",Date= " & "'" & "#" & ddate.Text & "#" & "'" & _ even i put it as ",Date= " & "'#" & ddate.Text & "#'" & _ not working too
",Date= " & "'" & "#" & ddate.Text & "#" & "'" & _ even i put it as ",Date= " & "'#" & ddate.Text & "#'" & _ The above lines equate to the same sting to send to the database. Both of which have ' around the date still. You don't need the single quotes for dates in access. Use the following: ",Date= " & "#" & ddate.Text & "#" & _
Mike Lasseter
-
",Date= " & "'" & "#" & ddate.Text & "#" & "'" & _ even i put it as ",Date= " & "'#" & ddate.Text & "#'" & _ The above lines equate to the same sting to send to the database. Both of which have ' around the date still. You don't need the single quotes for dates in access. Use the following: ",Date= " & "#" & ddate.Text & "#" & _
Mike Lasseter
-
Standard question #1: What do you mean by "not working"? Standard question #2: What error message do you get? You are probably using a date format that the database doesn't recognise.
--- b { font-weight: normal; }
-
pls refer to mr_lasseter response , i have try many way of those format. but when i save a new record it able to save it but when update , which mean edit the old record then have problem.
Guffa's questions are valid. From the last attempt that you made: Standard question #1: What do you mean by "not working"? Standard question #2: What error message do you get?
Upcoming Scottish Developers events: * UK Security Evangelists On Tour (2nd November, Edinburgh) * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog
-
pls refer to mr_lasseter response , i have try many way of those format. but when i save a new record it able to save it but when update , which mean edit the old record then have problem.
I would use the debugger to step the code and see what the update string that is sent to the database looks like. I would take this string and try to run it as a query in access. Figure out what you need to do to the string in order to get it to run in Access, then make the appropriate changes in your code.
Mike Lasseter
-
i had found my error which is the DATE cause the problem... anyway to update my DATE field?? will it becasue of the format? because i found out that my vb when i put"NOW" it will include the time with it. But with my access i had set it as DATE only. Date= " & "'" & ddate.Text & "'" & _ Here my full coding: DB.Execute "update DONO set NO=" & "'" & dono.Text & "'" & _ ",Date= " & "'" & ddate.Text & "'" & _ ",Customer=" & "'" & Combo1.Text & "'" & _ ",Description =" & "'" & ddes.Text & "'" & _ ",Total =" & "'" & temptotal.Caption & "'" & _ ",BillTerm=" & "'" & dterm.Text & "'" & _ " where [dono] = " & "'" & userin & "'"