The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Html + asp + Access Database, I'm trying to make a website , that will use ASP to enter data in
Blazedx
post Feb 18 2010, 10:40 AM
Post #1





Group: Members
Posts: 2
Joined: 18-February 10
Member No.: 11,130



tongue.gif
Can anyone help me find where i made a mistake, the thing is when i click on the submit details in my HTML page it only shows the coding of the ASP and doesn't do the actions.


Heres the HTML coding
QUOTE
<Html>
<Head>
<Title>
Loaner Equipement
</Title>
<style type="text/css">

table
{text-align:center;}

.left
{color: Black;
font: 19, algerian, bold;
border:2px groove blue;
width:756px;
height:200px;
float: left;
text-align: center;}



.right
{color: Black;
font: 19, algerian, bold;
border:2px groove blue;
width:756px;
height:200px;
float: left;
text-align: center;}



body
{background-color: rgb(175,175,175);}

.update
{color: Black;
font: 19, algerian, bold;
border:2px groove blue;
width:756px;
height:200px;
float: left;
text-align: center;}



.Others
{color: Black;
font: 19, algerian, bold;
border:2px groove blue;
width:756px;
height:200px;
float: left;
text-align: center;}



.lap
{color: Black;
font: 19, algerian, bold;
border:2px groove blue;
width:756px;
height:200px;
float: left;
text-align: center;}



.Projector
{color: Black;
font: 19, algerian, bold;
border:2px groove blue;
width:756px;
height:200px;
float: left;
text-align: center;}


td
{color: red;
font: 18, algerian;}

P
{color: red;
font: 18, algerian;}

h2
{color: Blue;
font: 30, Arial;
text-align:center;}
h3
{color: Blue;
font: 26, Arial;
text-align:center;}
</style>
</Head>
<Body>
<h1>Loaners Database </h1>

<form name="Form1" action="add_to_database.asp" method="post">
<div align = "center">

<div class="left">
<h2>Ticket information:</h2>
<table height="200" width="756px";>
<td>Client Name: <input type="text" name="ClientName" style= "width:115px"/> </td>
<td>ClientPhone#: <input type="text" name="ClientPhoneN" style= "width:130px"/> </td>
<td>Office Number: <input type="text" name="OfficeNumber" style= "width:140px"/> </td>
<td>RemedyID: <input type="text" name="RemedyID" style= "width:95px"/> </td>
<td>Technician: <input type="text" name="Technician"style= "width:110px"/> </td>
<td> </td>
<td><input type="submit" value="submit details" name="submit"></td>
</table>
</div>

<div class="right">
<h2>Dates discussed:</h2>
<table height="200" width="756px">
<td> Loan date: <br /> <input type="text" name="LoanDate"style= "width:100px"/> </td>
<td> Projected return date:<br /> <input type="text" name="ProjectedReturn" style= "width:220px"/></td>
<td> Returned on:<br /> <input type="text" name="Returneddate" style= "width:120px"/> </td>
<td> Technician initial's:<br /> <input type="text" name="Tech"style= "width:188px"/> </td>
</table>
</div>


<div class="lap">
<h2> Laptop:</h2>
<table height="200" width="756px">
<td> DOE: <input type="text" name="DOE" style= "width:60px" /> </td>
<td>Power adapter: <input type="Checkbox" name="PowerA" /> </td>
<td> Mouse : <input type="Checkbox" name="Mouse" /> </td>
<td> Lan cable: <input type="Checkbox" name="LAN" /> </td>
<td> Floppy Drive: <input type="Checkbox" name="Floppy" /> </td>
<td> Ras Card S/N : <input type="Text" name="RAS" style= "width:100px"> </td>
</table>
</div>
<div class="update">

<h2> Updates Dates/Installed: </h2>
<table height="200" width="756px">
<td>Microsoft Critical: <input type="TEXT" name="MicrosoftC" style= "width:60px"/> </td>
<td>Mcafee: <input type="TEXT" name="Mcafee" style= "width:60px"/> </td>
<td>VPN: <input type="Checkbox" name="VPN" /> </td>
<td> IPASS: <input type="CheckBox" name="IPASS"/> </td>
<td>Others (explain): <td><textarea name="Others"></textarea></td>

</table>
</div>
<div class="Projector">

<h2> Projector:</h2>
<table height="200" width="756px">
<td>DOE: <input type="text" name="ProjectorDOE" style= "width:60px" /></td>
<td>Power adapter: <input type="Checkbox" name="PowerA" /> </td>
<td> VGA: <input type="Checkbox" name="VGA" /> </td>
<td>Remote control: <input type="Checkbox" name="control" /> </td>
</table>
</div>

<div class="Others">
<h2> Other Equipement Loan:</h2>
<table height="200" width="756px">
<td>Equipement: <input type="text" name="Equipname" style= "width:120px" /></td>
<td> DOE: <input type="text" name="OtherDOE" style= "width:60px" /></td>
<td>Power adapter: <input type="Checkbox" name="PowerAd" /> </td>
<td> VGA : <input type="Checkbox" name="Mouse" /></td>
<td>Lan Cable : <input type="Checkbox" name="Lancable" /> </td>
</table>
</div>

</div>
</div>
</form>
</Body>
</Html>




And heres my ASP coding:
QUOTE
<%@ Language="VBScript" %>
<% Option Explicit %>
<html>
<head>
<title>Form to database</title>
</head>
<body>
<%
'declare your variables
Dim Clientname, ClientPhoneN, OfficeNumber, RemedyID, Technician, LoanDate, Projected, Returned, Tech, DOE, PowerA, Mouse, LAN, Floppy, RAS, MicrosoftC, Mcafee, VPN, IPASS, Others, ProjectorDOE, PowerA, VGA, control, Equipname, OtherDOE, PowerAd, Mouse, Lancable
Dim sConnString, connection, sSQL
'Receiving values from Form, assign the values entered to variables
Clientname = Request.Form("Clientname")
ClientPhoneN = Request.Form("email")
OfficeNumber = Request.Form("OfficeNumber")
RemedyID = Request.Form("RemedyID")
Technician = Request.Form("Technician")
LoanDate = Request.Form("LoanDate")
ProjectedReturn = Request.Form("Projected")
Returneddate = Request.Form("Returneddate")
Tech = Request.Form("Tech")

DOE = Request.Form("DOE")
PowerA = Request.Form("PowerA")
Mouse = Request.Form("Mouse")
LAN = Request.Form("LAN")
Floppy = Request.Form("Floppy")
RAS = Request.Form("RAS")
MicrosoftC = Request.Form("MicrosoftC")
Mcafee = Request.Form("Mcafee")
VPN = Request.Form("VPN")

IPASS = Request.Form("IPASS")
Others = Request.Form("Others")
ProjectorDOE = Request.Form("ProjectorDOE")
PowerA = Request.Form("PowerA")
VGA = Request.Form("VGA")
control = Request.Form("control")
Equipname = Request.Form("Equipname")
OtherDOE = Request.Form("OtherDOE")
PowerAd = Request.Form("PowerAd")
Mouse = Request.Form("Mouse")
Lancable = Request.Form("Lancable")


'declare SQL statement that will query the database
sSQL = "INSERT into Clients_tbl (Clientname, ClientPhoneN, OfficeNumber,RemedyID,Technician) values ('" & _
Clientname & "', '" & ClientPhoneN & "', '" & OfficeNumber & "', '" & RemedyID & "', '" & Technician & "')"
sSQL = "INSERT into Dates_tbl (LoanDate,Projected,Returned,Tech) values ('" & _
LoanDate & "', '" & Projected & "', '" & Returned & "', '" & Tech & "')"
sSQL ="INSERT into Laptop_tbl (DOE,PowerA,Mouse,LAN,Floppy,RAS) values ('" & _
DOE & "', '" & PowerA & "', '" & Mouse & "', '" & LAN & "', '" & Floppy & "', '" & RAS & "')"
sSQL ="INSERT into Updates_tbl (MicrosoftC,Mcafee,VPN,IPASS,Others) values ('" & _
MicrosoftC & "', '" & Mcafee & "', '" & ,VPN & "', '" & IPASS & "', '" & ,Others & "')"
sSQL ="INSERT into Projector_tbl (ProjectorDOE,PowerA,VGA,control) values ('" & _
ProjectorDOE & "', '" & ,PowerA & "', '" & ,VGA & "', '" & control & "')"
sSQL ="INSERT into Others_tbl (Equipname,OtherDOE,PowerAd,Mouse,Lancable) values ('" & _
Equipname & "', '" & ,OtherDOE & "', '" & ,PowerAd & "', '" & Mouse & "', '" & ,Lancable & "')"
'define the connection string, specify database
'driver and the location of database
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("loaners.mdb")
'create an ADO connection object
Set connection = Server.CreateObject("ADODB.Connection")

'Open the connection to the database
connection.Open(sConnString)

'execute the SQL
connection.execute(sSQL)

response.write "The form information was inserted successfully."
'Done. Close the connection object
connection.Close
Set connection = Nothing
%>
</body>
</html>


Thank you in advance and i hope you can help me, i'm getting desperate wink.gif







User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Feb 18 2010, 11:18 AM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



You probably need to find an M$-oriented forum for this -- I don't think many people here use asp.

But more generally, look up "debugging" and understand what it means. If your program doesn't work, *you* have to work out why not. You can't expect someone to just gaze at your program (running it, in their head) and tell you what's wrong.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Blazedx
post Feb 18 2010, 12:01 PM
Post #3





Group: Members
Posts: 2
Joined: 18-February 10
Member No.: 11,130



Yea well i tough maybe someone has had the same problem before where theyre ASP coding would just open in the other window after clicking submit im not asking to rewritte my code , just to send me on a trail cause i dont get why it does that.

This post has been edited by Blazedx: Feb 18 2010, 12:02 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Feb 18 2010, 02:03 PM
Post #4


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



Oh, sorry, I see: you mean that instead of seeing the *output* of the asp program, you see the program itself. So the server is not configured correctly to run asp programs. Again, what server is it?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 08:52 PM