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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get values from a access database?

Status
Not open for further replies.

kruxty

Programmer
Jul 17, 2001
197
PT
i want to make a login page with user and password.
But i want that this values will be fetch in a access DB.
How can i get values from a DB?
I already have the page with the user and password fields, just need the syntax to link with the DB!
All help... Tkx ;)
 
Something like this:

Code:
<%

Dim Conn,rs,strsql

Set rsName = Server.CreateObject("ADODB.Recordset")
Set MdConnection = Server.CreateObject("ADODB.Connection")

conn.Open strConnect

'strconnect is the connection string to your database...

strsql = "SELECT Username, Password FROM Login WHERE Username = '" & _ 
Request.Form("txtusername") & "' and Password = '" & _
Request.Form("txtpassword") & "'"

set rs = conn.Execute (strsql)

If (not rs.BOF) and (not rs.EOF) then
   Response.Redirect "logincorrect.asp"
else
   Response.Redirect "accessdenied.htm"
end if


'close the recordset
rsName.close
set rsName = nothing

'close the connection
conn.close
set conn = nothing

%>

-VJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top