This is a multi-part message in MIME format.
David, at a glance I don't see a problem with the code you've provided.
First thing to check is the spelling of your field names... misspelling
them is the most common cause of the "Too few parameters" error.
The remaining suggestions won't by themselves fix your problem, but your
code suggests structural problems which may, somewhere else, be leading
to confusion that's causing your current error.
- why do you have a different table for each user type? Surely users
share common characteristics (like a login ID, a password, perhaps
others). Maybe you could think about a single table Users, with a
column UserType that identifies which users are students, lecturers,
etc. If the different user types have characteristics that are not
shared by other types, then a separate table is used to store those.
For example, a separate Students table might contain data specific only
to students, and include a UserID column as the the "foreign key" to
their record in the Users table so the two tables can be joined on the
- why are you creating a different recordset variable for each user
type? From your description and code, it seems that a single recordset
variable might suffice for all user types, even if you retain your
separate tables for each user type.
- perhaps you stripped it out for simplicity of demonstrating here, but
your code shows no checking to ensure that the three values you're
retrieving from Request.Form are not empty or null, and that the value
you're retrieving using the Left() function is at least three characters
long. There's a high potential for trouble in this area, though not
usually the "Too few parameters" error.
- think about using the Select Case / End Select structure rather than
If Elseif Elseif End If
From: David Cameron [mailto:dcameron@i...]
Sent: Wednesday, March 06, 2002 10:37 PM
To: Code Clinic
Subject: [proasp_codeclinic] RE: using more than one recordset for a
conne ction object
From: feroz khan [mailto:feroz_77_city@h...]
Sent: Thursday, 7 March 2002 4:56 AM
To: Code Clinic
Subject: [proasp_codeclinic] using more than one recordset for a
Please could someone have a look at this which is an authentication
script for different types of users of my website. It is supposed to
read the first 3 letters of their userID to direct them to the
appropriate webpage. It does seem to work for the very first statement
(if strlog = "lec" then) and seems to point to the correct page but it
doesn't work for the others. Is there supposed to be another parameter
that i must include to differentiate between the other recordsets?. I
would appreciate any help, thank you.
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
/asp/checklogin3.asp, line 71
<% option explicit %>
<title>checking login details</title>
Dim objconn, strid1, strlog, strps, rslec, rsstu, rsstf, rsmrk,
strid1 = Request.Form("userid")
strlog = Left(Request.Form("userid"),3)
strps = Request.Form("passwordid")
set objconn = server.createobject("ADODB.Connection")
if strlog = "lec" then
QRY = "select * from LECTURER where Lecturer_ID
= '" & strid1 & "';"
rslec.open QRY, objconn, adopenstatic,
if rslec.EOF then
elseif strlog = "stu" then
QRY = "select * from STUDENT where Student_ID
= '" & strid1 & "';"
rsstu.open QRY, objconn, adopenstatic,
if rsstu.EOF then
elseif strlog = "mrk" then
QRY = "select * from MARKS STAFF where
Marks_staff_ID = '" & strid1 & "';"
rsmrk.open QRY, objconn, adopenstatic,
if rsmrk.EOF then
elseif strlog = "stf" then
QRY = "select * from TIMETABLE STAFF where
Time_staff_ID = '" & strid1 & "';"
rsstf.open QRY, objconn, adopenstatic,
if rsstf.EOF then
else response.redirect "login.asp"