Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

from form to dbase

Posted on 2000-02-28
11
Medium Priority
?
174 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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
 

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 160 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

916 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