PDA

Click to See Complete Forum and Search --> : Problem with ASP and SQL statements


Blitz
Apr 24th, 2001, 04:41 AM
Hi all,

I have the following SQL statement in my ASP page:

"SELECT Trainer.TrainerName, FeedBack.CourseID, Max(AttendanceList.ClassDate) AS EndDate, Avg(FeedBack.CourseCon1)
AS AvgOfCourseCon1;"

I'm using Access as my backend database and CourseCon1 is actually an Integer field.

I'm able to call out the values of the rest of the fields but when I type this:

<%= rs("AvgOfCourseCon1") %>

It gaves me this error:

Microsoft VBScript runtime error '800a000d'

Type mismatch

/classrate.asp, line 122

What actually went wrong?

Thanks for any help!! :D

JoshT
Apr 24th, 2001, 06:27 AM
See if something like this helps:

<%= CString(rs("AvgOfCourseCon1")) %>

Blitz
Apr 24th, 2001, 07:30 AM
Thanks Josh, will try tomorrow when I get back to my office again :)

JoshT
Apr 24th, 2001, 08:34 AM
Should be <%= CStr(rs("AvgOfCourseCon1")) %>, not "CString". Also, is there a chance your rs is returning a Null value?

Blitz
Apr 24th, 2001, 09:50 AM
Oh I've already try using the CStr() function too but it doesn't works :(

I have try the SQL statements in Microsoft Access and it does return me values.

Any solutions to that?

kayoca
Apr 25th, 2001, 02:55 AM
Are you sure this is the error line on your ASP page

<%= rs("AvgOfCourseCon1") %>


Type mismatch

/classrate.asp, line 122

Sometimes "with my experiences" give the error handler the wrong page line.