Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type mismatch

Status
Not open for further replies.

manicleek

Technical User
Jun 16, 2004
143
GB
I keep getting the error

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'editRS'
/clientedit/edit.asp, line 266

with the following code

Code:
Server.ScriptTimeout = 1000 
 
username = request.form("username")
password = request.form("password")

If Session("user") <> true then
loginSQL = "SELECT * FROM dataqfol WHERE username LIKE '" & username & "' AND password LIKE '" & password & "'"
Set loginRS = server.CreateObject("ADODB.recordset")
loginRS.open loginSQL, objConn

if loginRS.EOF then
		Response.Redirect("unknown.asp")
else
		Session("user") = true
end if

else

SQL = "SELECT * FROM dataqfol WHERE username LIKE '" & username & "' AND password LIKE '" & password & "'"
Set editRS = server.CreateObject("ADODB.recordset")
editRS.open SQL, objConn

if editRS.EOF then
		Response.Redirect("unknown.asp")

end if
end if

the line in question has this on it

Code:
<%= editRS("Company") %>

can anyone help with the problem?
 
in addition to this, when I click refresh it works, its only when you try and initially log in that I am getting this error
 
Have you tried running the SQL script by itself (to make sure you are not getting errors)?

 
Have you tried dimming editRs before setting it?

example:

Dim editRs

regards,
Brian
The problem with doing something right the first time is that nobody appreciates how difficult it was.
 
the problem looks to be your logic with the session variable because if it is false editRS never gets created.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top