Results 1 to 6 of 6

Thread: Problem with ASP and SQL statements

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    78
    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!!

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    See if something like this helps:
    Code:
    <%= CString(rs("AvgOfCourseCon1")) %>
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    78
    Thanks Josh, will try tomorrow when I get back to my office again

  4. #4
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Should be <%= CStr(rs("AvgOfCourseCon1")) %>, not "CString". Also, is there a chance your rs is returning a Null value?
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    78
    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?

  6. #6
    kayoca
    Guest
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width