Found the bug. And I think there is some kind of bug in
the VS.NET debugger. It was a missing ".Value" but the
debugger gave wrong line number. I had an include file
where the the ".Value" was missing. I found it by moving
a "respond.end" through the code until an error
generated. Eventually, I was putting the "respond.end"
into the include file until I saw the missing ".Value".
The strange thing is that, when I tried to reproduce the
bug by taking out the ".Value," the error page produced
the correct error. So, I can't pass this one on the
Microsoft for review.
>-----Original Message-----
>"William Mild" <(E-Mail Removed)> schrieb
>> I am porting old Dreamweaver generated ASP code to
>> ASP.NET (VBScript to VB.NET).
>> Error: Cast from type 'Field' to type 'Integer' is not
>> valid
>> The error occurs on the line which says "rsStudents =
>> Server.CreateObject("ADODB.Recordset")".
>>
>>
>> if (Request.QueryString("StudentID") <> "") then
>> rsStudents__MMColParam = Request.QueryString
("StudentID")
>>
>> Dim rsStudents
>> rsStudents = Server.CreateObject("ADODB.Recordset")
>> rsStudents.ActiveConnection = MM_cnReportCards_STRING
>> rsStudents.Source = "SELECT * FROM dbo.Student WHERE
>> StudentID = " & Replace
>> (rsStudents__MMColParam, "'", "''") & ""
>> rsStudents.CursorType = 0
>> rsStudents.CursorLocation = 2
>> rsStudents.LockType = 3
>> rsStudents.Open()
>> Dim rsStudents_numRows As Integer = 0
>>
>> Any ideas, besides rewriting the whole thing using a
>> datareader?
>
>
>In your last thread you solved the problem by
adding ".value". I'd do the
>same again...
>
>
>--
>Armin
>
>.
>
|