|
a04014 -> Type mismatch: '[string: "Y"]' (11/11/2005 14:46:07)
|
i get this error: Microsoft VBScript runtime error '800a000d' Type mismatch: '[string: "Y"]' /PICKLER/cm/delay_info_cm.asp, line 154 I think its because i was using an array to get data from database that was 1's and 0's and now i am looking for Y'S and N'S. How do i change the code to make up for this? Thanks ...Here is the line where the problem occurs : If RecSet(BreakDownHandle)("stand_" & stand & "_affected") Then But here is the code: Dim DelayInfoHandle InfoTableCode = InfoTableCode & "<table border=""0"" width=""800""><tr><td width=""80"">Start</td><td width=""80"">End</td><td width=""80"">Duration (Mins)</td><td width=100>Stands Ch.</td><td width=200>Description</td><td width=100>Responsible</td></tr>" DelayInfoHandle = RunQuery("ColdMillProduction", "C:\Inetpub\wwwroot\pickler\SQL\cmprodelayinfoquery.SQL", ParamList) If RecSet(DelayInfoHandle).BOF And RecSet(DelayInfoHandle).EOF Then InfoTableCode = InfoTableCode & "<tr><td colspan=""5""><p align=""center"">No delays for " & CurrentDate & " Turn " & CurrentTurn & ".</td></tr></table>" Else Dim StandsHandle Dim BreakDownHandle Dim StandsChanged Dim Description Dim stand 'Counter for the stand number Dim seqNum 'The key which is used to store things in the StandsChanged and Description dictionaries. It is formed from 'concatenating the date, turn, and sequence number 'Key: Turn Date & Turn & Sequence, Item: Description of delays Set Description = Server.CreateObject("Scripting.Dictionary") 'Key: TurnDate & Turn & Sequence, Item: Description of delays Set StandsChanged = Server.CreateObject("Scripting.Dictionary") 'Stores all breakdown info at once because it is faster to store it all now than query for it only when we need it BreakDownHandle = RunQuery("ColdMillProduction", "C:\Inetpub\wwwroot\pickler\SQL\cmproDelayBreakdownQuery.sql", ParamList) While Not RecSet(BreakDownHandle).EOF seqNum = Cstr(CurrentDate & CurrentTurn & RecSet(BreakDownHandle)("sequence")) If Description.Exists(seqNum) Then Description(seqNum) = Description(seqNum) & "<br>" & Trim(RecSet(BreakDownHandle)("DELAY_REASON_DEF")) Else Description.Add seqNum, Trim(RecSet(BreakDownHandle)("DELAY_REASON_DEF")) End If If Trim(RecSet(BreakDownHandle)("EVENT_COMMENT")) <> "" Then Description(seqNum) = Description(seqNum) & "-" & Trim(RecSet(BreakDownHandle)("EVENT_COMMENT")) End If For stand = 1 to 5 If RecSet(BreakDownHandle)("stand_" & stand & "_affected") Then Description(seqNum) = Description(seqNum) & ", " & stand End If Next RecSet(BreakDownHandle).MoveNext 'If Not RecSet(BreakDownHandle).EOF Then 'Description(seqNum) = Description(seqNum) & VbCrLf Wend CloseRS(BreakDownHandle) 'Stores all stands changed info at once, for the same reason as the Breakdown info StandsHandle = RunQuery("ColdMillProduction", "C:\Inetpub\wwwroot\pickler\SQL\cmproDelayStandsQuery.sql", ParamList) While Not RecSet(StandsHandle).EOF seqNum = CSTR(CurrentDate & CurrentTurn & RecSet(StandsHandle)("sequence")) If RecSet(StandsHandle)("WR_CHANGED_SFLAG") Or RecSet(StandsHandle)("TOP_BUR_CHANGED_SFLAG") Or RecSet(StandsHandle)("BOT_BUR_CHANGED_SFLAG") Then If StandsChanged.Exists(seqNum) Then StandsChanged(seqNum) = StandsChanged(seqNum) & ", " & RecSet(StandsHandle)("stand_num") Else StandsChanged(seqNum) = StandsChanged(seqNum) & RecSet(StandsHandle)("stand_num") End If End If RecSet(StandsHandle).MoveNext Wend CloseRS(StandsHandle)
|
|
|
|