Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works


  • Please log in to reply




  • Member
  • PipPip
  • 10 posts

i have come to the conclusion i have problem in one of two areas and ive spent two days tring to figure it out.

First the error i get is below with this code:

ParamList(1) = reportDate
ParamList(0) = month(reportDate) & "/1/" & Year(reportDate)

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E57)
[Oracle][ODBC][Rdb]%RDB-E-ARITH_EXCEPT, truncation of a numeric value at runtime -SQL-F-DATCONERR, Data conversion error for string '1109-20-05' -COSI-F-IVTIME, invalid date or time
/PICKLER/common/connect.asp, line 201

So i though oh in my code i have to prepend the pound sign in this part of the code below:

ParamList(1) = "#" & reportDate
ParamList(0) = "#" & month(reportDate) & "/1/" & Year(reportDate)

But now i get an error:

ADODB.Command error '800a0d5d'

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

/PICKLER/common/connect.asp, line 195

The code on this line 195 is:
Cmd.Parameters.Append Cmd.CreateParameter(TempName, TempType, adParamInput, 50, TempParam)

What did i do wrong?

Any help would be greatly appeciated!!
  • 0




    Member 1K

  • Member
  • PipPipPipPip
  • 1,382 posts
Hi edwardel,
The pound symbol is used directly with the Date datatype in VBS. But since the ParamList comes from ADO it requires a string so there is no need to use the pound symbol.

The error your getting because of date convention defined by you in the DB. If you look at the first error message closely, Oracle is expecting the date in the yyyy-mm-dd format.
You have two options from here: either convert reportDate in the VBS to the required Oracle format, by using the Format method; Or, convert the date format in Oracle.
  • 0




  • Topic Starter
  • Member
  • PipPip
  • 10 posts
So could i just add this to my code makeing the code think this is what the date is supposed to be. Something like this below:

Dim reportDate, MyStr

reportDate = #11/16/2005#

' Returns current system date in the system-defined short date format.
MyStr = Format(Date, "Short Date")
MyStr = Format(reportDate, "yyyy/mm/dd")

' If format is not supplied, a string is returned.
MyStr = Format(23)
  • 0




  • Topic Starter
  • Member
  • PipPip
  • 10 posts
this is what i have now just for your info.


'Each statistic will have 6 elements in an array. 0 is used for the month through the report day, 1, 2, and 3 are used for the 11-7, 7-3, and 3-11\
'turns, 4 is used for the sum for the whole day, and 5 is used for month to date including the report date.

Dim Hours(6)
Dim DelayMinutes(6)
Dim CoilsIn(6)
Dim CoilsOut(6)
Dim Tons(6)
Dim LinearFeet(6)
Dim AvgWidth(6)
Dim Turns(6)

Dim TonsPerHour(6)
Dim FeetPerRollHourEff(6)
Dim TonsPerCoil(6)
Dim FeetPerCoil(6)
Dim PoundsPerFoot(6)
Dim AverageGauge(6)
Dim CSA(6)
Dim Availability(6)

Dim reportDate

If Request.Cookies("SEL_DATE") <> "" And IsDate(Request.Cookies("SEL_DATE")) Then
reportDate = Request.Cookies("SEL_DATE")
reportDate = Date

End If

If cDate(reportDate) >= Date Then Response.Write("Warning: You have chosen to generate a report for a day which still has turns remaining.<br>The information in the report may not yet be finalized.")

Dim ParamList(2)
Dim InfoHandle
'We want the information for the whole month until the report date so our first parameter should be the first of the month.
'We do not need to prepend a "#" because the cold mill is currently in an SQL database. When it switches to the RDB this must be modified.

ParamList(1) = reportDate
ParamList(0) = Year(reportDate) & month(reportDate) & " / 1/ "

Edited by edwardel, 16 November 2005 - 08:39 AM.

  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP