Learn what a *STRING* is!
That is, what constitutes a LITERAL (quoted) string.
A literal string starts with a " mark and continues until the VERY NEXT " mark. *EVERYTHING* between the two " marks is considered JUST CHARACTERS and is *NEVER* considered to be code.
So in your line:
if rc.eof or ("&rc.fields("password")<>password&") then
You have two strings. As shown here:
if rc.eof or ("&rc.fields("password")<>password&") then
Remember what I said: Characters inside quote marks are *NOT* code.
So you could just as easily have written
if rc.eof or ("zambonis"password"rule") then
And so the compiler breaks that down as
... or ( [string] password [string] )
and since password is MEANINGLESS to VBScript, of course you get an error!
What I *THINK* you were after would be this:
if rc.eof or (rc.fields("password")<>password) then
BUT!!! But that *STILL* won't work!
The reason: VBScript doesn't use "shortcut" operators for AND and OR. So *all* the parts of an AND or OR logical expression are evaluate *BEFORE* the AND or OR is actually used.
Which means *NO MATTER WHETHER you are at the EOF or not, VBScript will *STILL* try to execute the
rc.fields("password")
code! So if you *ARE* at EOF, then you will get an error from that code!
....
So...let's TOSS OUT all your code and rewrite it. And, in the process, we will protect you against SQL Injection attacks:
Code:
f_name = Trim(request.form("f_name"))
password = Trim(request.form("password"))
path = server.mappath("mytfasim.mdb")
set conn=server.createobject("ADODB.Connection")
' you *REALLY* should *NOT* use the Access Driver!
' it is BUGGY and unreliable compared to the JET OLEDB driver
conn.open "driver={Microsoft Access Driver (*.mdb)}; DBQ=" & path
SQL = "SELECT * From tabla1 " _
& " WHERE f_name = '" & Replace(f_name,"'","''") & "' " _
& " AND [password] = '" & Replace(password,"'","''") & "'"
' (we must put [...] around the field name because password is keyword in Access)
SET rc = conn.execute( SQL )
If rc.eof Then
rc.Close
conn.Close
session("userchek")="false"
response.redirect "pleaseregister.htm"
' No need for "ELSE" here! Redirect happens *immediately* and
' no code after the redirect will be executed!
End If
session("userchek")="true"
...
%>