: You can use else...
:
: :
: : <%
: : dim nameFld, pwFld
: : nameFld=request.form("nameFld")
: :
: : pwFld=request.form("pwFld")
: :
: : if nameFld="" then
: : response.write("Please enter a user name") &""
: : else if pwFld="" then
: : response.write("Please enter a password") &""
: : end if
: :
: : %>
: : ...
: :
:
: nICO
:
:
:
How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.
: JOHN KEATS
:
:
:
Thank you. This problem is solved. But I can't connect to the SQL server. I am not sure where I am wrong?
<%
dim nameFld, pwFld
nameFld=request.form("nameFld")
pwFld=request.form("pwFld")
if nameFld="" then
response.write("Please enter a user name") &""
elseif pwFld="" then
response.write("Please enter a password") &""
end if
%>
<%
dim conn, objRds
set conn = server.createobject("ADODB.Connection")
set objRds=Server.CreateObject("adodb.recordset")
conn.Provider ="SQL SERVER"
conn.ConnectionString = "dsn=Vehicle;uid=sa;Pwd="
conn.open
%>
<%
strSQL="select * from login where login_name='"&nameFld&"' and login_pw='"&pwFld&"'"
set ojbRds=conn.Execute(strSQL)
if objRds.recordcount=0 then
Response.Write("Wrong login info.")
end if
%>
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/vehicleasp/login.asp, line 36
Judy