Solved

from form to dbase

Posted on 2000-02-28
11
147 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:sash031299
  • 7
  • 2
  • 2
11 Comments
 
LVL 8

Expert Comment

by:xabi
Comment Utility
Hi there:

Here goes a simple example in ASP:

------ 8< ------- 8< -----
srtDataBaseConnectionString = "Data Source=" & Server.MapPath ("/cgi-bin/mydatabase.mdb")
Set AdoConn = Server.CreateObject ("ADODB.Connection")
AdoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
AdoConn.ConnectionString = srtDataBaseConnectionString
AdoConn.Open
sSql = "SELECT field1 FROM mytable"
set rsTmp = AdoConn.Execute (sSql)
do until rsTmp.eof
  response.write(rsTmp("myfield1") & "<br>")
  rsTmp.movenext
loop
AdoConn.close
Set AdoConn = nothing
---------- 8< ------- 8< -------
xabi
0
 

Author Comment

by:sash031299
Comment Utility
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 :)
0
 
LVL 8

Expert Comment

by:xabi
Comment Utility
sUser = Request("user")
sSql = "SELECT points FROM mytable WHERE user='" & sUser & "'"
..
..
response.write(rsTmp("points"))
..
..

xabi
0
 

Author Comment

by:sash031299
Comment Utility
sorry, but where do i put this??
0
 

Author Comment

by:sash031299
Comment Utility
Adjusted points to 45
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:sash031299
Comment Utility
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 :)
0
 
LVL 4

Expert Comment

by:FRehman
Comment Utility
<!--#include file="adovbs.inc"-->
<%
Dim loginName, pwd
loginname=""
pwd=""
loginName=Request.QueryString("Uname")
pwd       =Request.QueryString("pwd")
set Myconn=server.CreateObject("ADODB.connection")
Myconn.Open "DRIVER={MicroSoft Access Driver (*.mdb)};DBQ=" & server.MapPath("./test.mdb")
set rs=server.CreateObject("ADODB.recordset")
rs.open "Select * from Login where usrName='" &loginName& "' and pwd='" &pwd& "'" ,Myconn ,adOpenDynamic,adLockOptimistic
if  rs.eof then
response.redirect("page1.asp")
else
response.redirect("page2.asp")
end if      
      

%>

0
 

Author Comment

by:sash031299
Comment Utility
Adjusted points to 50
0
 

Author Comment

by:sash031299
Comment Utility
i bet this would work, but where do i put it and how do i link it to my form??
0
 
LVL 4

Accepted Solution

by:
FRehman earned 80 total points
Comment Utility
it call from first page in first page u have two textbox one is for login and other is for password then u submit the form you should put the action to that page if u still facing problem then let me know at leo_faisal@yahoo.com
0
 

Author Comment

by:sash031299
Comment Utility
Adjusted points to 80
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now