473,408 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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 7109
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dan | last post by:
I've run into an interesting problem, and seemed to have stumped 3 newsgroups and 2 other forums. For some reason when I try to insert a record into a SQL table that has a Text column, the...
3
by: Aguilar, James | last post by:
Hey all. I was making a newbie mistake that I eventually figured out. That is not my question. My question is about the error message. So let me set the stage for you: class Superclass {...
4
by: Andy Davis | last post by:
I have developed a number of reports that are based on parameter queries where the user enters criteria such as a date range and a sales rep say. I want to be able to show a graphical picture in...
20
by: Brien King | last post by:
If I have a parameter that has an Object type (as opposed to something like a string), can I make that parameter a CONST? Right now, if you pass an object into a sub/function, that sub/function...
4
by: Martin Evans | last post by:
Hi, I'm getting: DBD::DB2::db do failed: SQL0440N No authorized routine named "CONCAT" of type "FUNCTION" having compatible arguments was found. SQLSTATE=42884 for some SQL like this:
10
by: Zoe Hart | last post by:
I have a wsdl file that I received from a third party and I'm using wsdl.exe (.NET 2.0) to import it and generate a proxy class. I've actually got a proxy class that works, but I'm trying to...
2
by: Joseph Lu | last post by:
Hi, I have a multithread problem like the following lines, when I compile this code I caught a "error C2665", the error description is : none of the number1 overloads can convert parameter number2...
16
by: hzmonte | last post by:
Correct me if I am wrong, declaring formal parameters of functions as const, if they should not be/is not changed, has 2 benefits; 1. It tells the program that calls this function that the...
6
by: humblemark | last post by:
Hello, I try to give a parameter in the function tt; but omething went wrong?? Any idea what i can do?? int ret_integer() { return 76;
13
by: masso600 | last post by:
char word; in = fopen("test.txt", "r"); while(fscanf(in,"%s",&word)!=EOF) { /* Print all words */ /* printf("%s\n",&word); */
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.