sash031299
asked on
from form to dbase
first, i will give more points (200) to the person that gives me a good answer :) i just dont have to point now...
is there a way that i can make a web form write to a access database that i have made. all i want is something like this site. i want the user to make a account from a form, then login. i want all this info to be in a database so i can make reports on it later. can someone show me how to do this. i know how to make forms and webpages. i am only intrested to the link to the dbase... thanks \
mark
is there a way that i can make a web form write to a access database that i have made. all i want is something like this site. i want the user to make a account from a form, then login. i want all this info to be in a database so i can make reports on it later. can someone show me how to do this. i know how to make forms and webpages. i am only intrested to the link to the dbase... thanks \
mark
ASKER
thanks, but this is only part of the prob. how do i get a form to check if there is a user like that, and display a feild. like how many points you have got left on your account. i have got a feild called "points" and i want to show it on my page depending on who logs in. thanks again :)
sUser = Request("user")
sSql = "SELECT points FROM mytable WHERE user='" & sUser & "'"
..
..
response.write(rsTmp("poin ts"))
..
..
xabi
sSql = "SELECT points FROM mytable WHERE user='" & sUser & "'"
..
..
response.write(rsTmp("poin
..
..
xabi
ASKER
sorry, but where do i put this??
ASKER
Adjusted points to 45
ASKER
ok, i have made a form that adds data to a database. i have got two fields (username and password). all i need now is a form that checks the data, (compares the data in the database to what the use has just inputed into the form)and if the username and password is the same as in the database, loads one page, and if not, loads another (error)... how do i do this??? pls help me :)
<!--#include file="adovbs.inc"-->
<%
Dim loginName, pwd
loginname=""
pwd=""
loginName=Request.QueryStr ing("Uname ")
pwd =Request.QueryString("pwd" )
set Myconn=server.CreateObject ("ADODB.co nnection")
Myconn.Open "DRIVER={MicroSoft Access Driver (*.mdb)};DBQ=" & server.MapPath("./test.mdb ")
set rs=server.CreateObject("AD ODB.record set")
rs.open "Select * from Login where usrName='" &loginName& "' and pwd='" &pwd& "'" ,Myconn ,adOpenDynamic,adLockOptim istic
if rs.eof then
response.redirect("page1.a sp")
else
response.redirect("page2.a sp")
end if
%>
<%
Dim loginName, pwd
loginname=""
pwd=""
loginName=Request.QueryStr
pwd =Request.QueryString("pwd"
set Myconn=server.CreateObject
Myconn.Open "DRIVER={MicroSoft Access Driver (*.mdb)};DBQ=" & server.MapPath("./test.mdb
set rs=server.CreateObject("AD
rs.open "Select * from Login where usrName='" &loginName& "' and pwd='" &pwd& "'" ,Myconn ,adOpenDynamic,adLockOptim
if rs.eof then
response.redirect("page1.a
else
response.redirect("page2.a
end if
%>
ASKER
Adjusted points to 50
ASKER
i bet this would work, but where do i put it and how do i link it to my form??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Adjusted points to 80
Here goes a simple example in ASP:
------ 8< ------- 8< -----
srtDataBaseConnectionStrin
Set AdoConn = Server.CreateObject ("ADODB.Connection")
AdoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
AdoConn.ConnectionString = srtDataBaseConnectionStrin
AdoConn.Open
sSql = "SELECT field1 FROM mytable"
set rsTmp = AdoConn.Execute (sSql)
do until rsTmp.eof
response.write(rsTmp("myfi
rsTmp.movenext
loop
AdoConn.close
Set AdoConn = nothing
---------- 8< ------- 8< -------
xabi