Solved

from form to dbase

Posted on 2000-02-28
11
170 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

737 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