Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Asp datetime problem with non-Unicode languages

hi everybody,

i have datetime problem with my access database

im not able to update the datetime field in the msaccess table using

objcon.execute "update users set us_userlastlogin='" & now() & "' where us_userid= '" & us_userid & "'"

i have non-Unicode language as Arabic in Regional and Language Option in the control panel. When i change this to US english eerything works fine.

But if it is arabic, the query is works as

update users set us_userlastlogin='03/03/2007 05:44:21 م' where us_userid= 'anas'

instead of

update users set us_userlastlogin='03/03/2007 05:44:21 PM' where us_userid= 'anas'

ie the datetime field doesnt accept م character

is there any convert or alternative methods for this?

thank you
neon
[893 byte] By [neon20] at [2007-11-11 10:31:30]
# 1 Re: Asp datetime problem with non-Unicode languages
The first thing you need to do is enclose the date value within pound sign characters instead of single quotes. I don't know whether this will allow you to store with the Arabic character. You may have to use the U.S. format when storing the date.

An alternative would be to use a Command object with parameters so that you don't have to worry about this sort of syntax issue.
pclement at 2007-11-11 23:11:47 >
# 2 Re: Asp datetime problem with non-Unicode languages
hi paul,

thank you for the reply

i tried with # sign instead of the single quote.

gives error as follows
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query expression '#06/03/2007 11:33:41 ص#'.

what you mean by pound sign? i also tried , but same error.

neon
neon20 at 2007-11-11 23:12:43 >