06-21-2002, 09:07 PM
I'm new to ASP. What i want to do is to check the "Username" and "password" with the database. My database and all the files are present in IIS server. I'm using oracle9i.
Please just give me the simple script to go about. I'll manage try and error method right now. It seems easy in VB. and i'm using vbscript. and in submit button i want to validate both.
Please help me
06-22-2002, 09:05 AM
On your login page you would use something like....<FORM METHOD="Post" ACTION="checkpassword.asp">
<INPUT TYPE=Text NAME="txtUserName" MAXLENGTH=25>
<INPUT TYPE=Password NAME="txtPassword" MAXLENGTH=15>
</FORM>Then, on checkpassword.asp, you would use...
"SELECT [UserName] " & _
"FROM Users " & _
"WHERE [UserName]='" & request("txtUserName") & "' " & _
"AND [Password]='" & request("txtPassword") & "'", adoCon, 3, 3, 1
if RS.Recordcount > 1 then
response.write "Password good"
response.write "Password bad"
end ifThis assumes, of course, that you have your recordset and connection objects created and initialized. A few things to consider:
1) You can check the username/password on the same page the login occurs by using something like ACTION=samepage.asp?method=check. Then, if errors occur you can display them right there.
2) This simple script does not really defend against an SQL Injection attack.
06-24-2002, 02:11 AM
Thank you for your help. I have IIS server and database is oracle. so how can i do my connection string. Please tell me in generalised way what should be my connection string to connect to the database.
06-25-2002, 04:24 AM
Please help me how can i set IIS on the connection strin. In general term tell me.
i don't want exact code
06-25-2002, 05:35 PM
here's a list http://www.able-consulting.com/ADO_Conn.htm#DSNLess