Solved

from form to dbase

Posted on 2000-02-28
11
153 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
ID: 2567891
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
ID: 2567902
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
ID: 2567958
sUser = Request("user")
sSql = "SELECT points FROM mytable WHERE user='" & sUser & "'"
..
..
response.write(rsTmp("points"))
..
..

xabi
0
 

Author Comment

by:sash031299
ID: 2567997
sorry, but where do i put this??
0
 

Author Comment

by:sash031299
ID: 2568024
Adjusted points to 45
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:sash031299
ID: 2568314
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
ID: 2571678
<!--#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
ID: 2571990
Adjusted points to 50
0
 

Author Comment

by:sash031299
ID: 2571991
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
ID: 2572325
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
ID: 2590712
Adjusted points to 80
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

910 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

24 Experts available now in Live!

Get 1:1 Help Now