VB Date Format
am 23.03.2006 17:35:53 von Mike
I am upgrading from an NT4 IIS4 server to a new Server running 2003 and IIS6
and have a problem with date format in VB. I have several web pages that use
the date command as part of SQL strings to read or write data to ether an
Oracle, SQL, PI, or Access databases. The problem is the date function is
pulling the current date format as 372006 instead of 03072006. It dropping
the leading zeros and the databases don't know what to do with it. This
worked fine with the old server and I think it is just a configuration
problem with the new server. I have already logged on as administrator and
changed the regional setting to the correct format but that did not fix the
problem. I know I can change each page by writing a script that will read
the date and correct the format but that is a lot of pages and I have to keep
downtime to a minimum. Does anyone have any idea what I need to change on
the server to make this work?
VB Code:
'Add the current Date to the SQL string
editdate = date
strSQL = strSQL & ", edit_date = '"
strSQL = strSQL & cstr(editdate) & "'"
Thanks for your time.
Mike
Re: VB Date Format
am 23.03.2006 17:46:23 von reb01501
Mike wrote:
> I am upgrading from an NT4 IIS4 server to a new Server running 2003
> and IIS6 and have a problem with date format in VB. I have several
> web pages that use the date command as part of SQL strings to read or
> write data to ether an Oracle, SQL, PI, or Access databases. The
> problem is the date function is pulling the current date format as
> 372006 instead of 03072006. It dropping the leading zeros and the
> databases don't know what to do with it. This worked fine with the
> old server and I think it is just a configuration problem with the
> new server. I have already logged on as administrator and changed
> the regional setting to the correct format but that did not fix the
> problem. I know I can change each page by writing a script that will
> read the date and correct the format but that is a lot of pages and I
> have to keep downtime to a minimum. Does anyone have any idea what I
> need to change on the server to make this work?
>
> VB Code:
>
> 'Add the current Date to the SQL string
> editdate = date
> strSQL = strSQL & ", edit_date = '"
> strSQL = strSQL & cstr(editdate) & "'"
>
>
Don't depend on your server settings for this.
http://www.aspfaq.com/show.asp?id=2313
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.