469,356 Members | 2,016 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

ADO Parameter of The Wrong Type

Hiya.

I've taken over the development of a web app written in ASP. It's not
very well coded. In the live environment it's fine, but on my local
machine it falls over whenever it tries to pass a date to a SQL Server
sproc. No idea why the person before me's been doing all this string
formatting with his dates, but anyway, the error is:

Application uses a value of the wrong type for the current operation.

The dates throughout are in mmddyyyy format, and presumably ADO
running on my local machine wants ddmmyyyy. I'm rebuilding the whole
app in C#.Net anyway so I don't think it's worth me running through
and making this jumble of code international date friendly, so my
question is, where exactly is the date format for ADO defined?
Windows? SQL Server?

Thanks loads!

Gargamel.
Jul 19 '05 #1
2 7022
Gargamel wrote:
Hiya.

I've taken over the development of a web app written in ASP. It's not
very well coded. In the live environment it's fine, but on my local
machine it falls over whenever it tries to pass a date to a SQL Server
sproc. No idea why the person before me's been doing all this string
formatting with his dates, but anyway, the error is:

Application uses a value of the wrong type for the current operation.

The dates throughout are in mmddyyyy format, and presumably ADO
running on my local machine wants ddmmyyyy. I'm rebuilding the whole
app in C#.Net anyway so I don't think it's worth me running through
and making this jumble of code international date friendly, so my
question is, where exactly is the date format for ADO defined?
Windows? SQL Server?

Thanks loads!

Gargamel.


http://www.aspfaq.com/show.asp?id=2040
HTH,
Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2
Hi,

It depends... :-)

Each user has their own settings, and ASP, IIS, and SQL Server can all be
running under different user accounts (for an extreme example).

If you are passing string literal dates via ADO to SQL Server, then the best
format is yyyy/mm/dd (or some other version of ISO date formats that can be
miscontrued). String literals need to be parsed by SQL Server, and converted
to a valid date/time format.

Cheers
Ken

"Gargamel" <ga******@tiscali.co.uk> wrote in message
news:9b**************************@posting.google.c om...
: Hiya.
:
: I've taken over the development of a web app written in ASP. It's not
: very well coded. In the live environment it's fine, but on my local
: machine it falls over whenever it tries to pass a date to a SQL Server
: sproc. No idea why the person before me's been doing all this string
: formatting with his dates, but anyway, the error is:
:
: Application uses a value of the wrong type for the current operation.
:
: The dates throughout are in mmddyyyy format, and presumably ADO
: running on my local machine wants ddmmyyyy. I'm rebuilding the whole
: app in C#.Net anyway so I don't think it's worth me running through
: and making this jumble of code international date friendly, so my
: question is, where exactly is the date format for ADO defined?
: Windows? SQL Server?
:
: Thanks loads!
:
: Gargamel.
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Aguilar, James | last post: by
20 posts views Thread by Brien King | last post: by
4 posts views Thread by Martin Evans | last post: by
16 posts views Thread by hzmonte | last post: by
6 posts views Thread by humblemark | last post: by
13 posts views Thread by masso600 | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.