.asp Post = Blank Table

S

Steve Leary

I wrote short asp and html files to allow users to enter info into four
text boxes. The .asp sends the info to a 1 row ms access database
table using update (tried insert as well). The code connects to the
database, but instead of updating or inserting the entries from the
form, it updates (or inserts) blanks. If anyone knows why, please help
me. All I want is to take the 4 form entries and store them for
distribution to other apps.

HTML:

<form name = "formEntry" action="Test_Engr_projects.asp" method="post"
enctype="application/x-www-form-urlencoded">


<LABEL for="partnum">Part Number: </LABEL>
<INPUT TYPE="TEXT" SIZE="82" NAME="partnum" ID = "partnum">
<LABEL for="rev">Revision: </LABEL>
<INPUT TYPE="TEXT" SIZE="82" NAME="rev" ID = "rev">
<LABEL for="projname">Project Name: </LABEL>
<INPUT TYPE="TEXT" SIZE="82" NAME="projname" ID "projname">
<LABEL for="engr">Project Engineer: </LABEL>
<INPUT TYPE="TEXT" SIZE="82" NAME="engr" ID = "engr">
<p><INPUT TYPE="SUBMIT" value = "Submit Info"></p>
</form>


ASP:

Dim PartNumber, Rev, ProjectName, ProjectEngineer
Dim ConnectionString, Connection,
SQLupdate1,SQLupdate2,SQLupdate3,SQLupdate4

'declare SQL statement that will query the database

SQLupdate1 = "Update Shared_Entry SET Part_Number = '" & PartNumber &
"'"
SQLupdate2 = "Update Shared_Entry SET Revision = '" & Rev & "'"
SQLupdate3 = "Update Shared_Entry SET Project_Name = '" & ProjectName &
"'"
SQLupdate4 = "Update Shared_Entry SET Project_Engineer = '" &
ProjectEngineer & "'"


'sql_insert = "insert Shared_Entry (Part_Number, Revision,
Project_Name, Project_Engineer) values ('" & _
'Part_Number & "', '" & Revision & "', '" & Project_Name & "', '" &
Project_Engineer & "')"

' Receiving values from Form, assign the values entered to variables

PartNumber = Request.Form("partnum")
Rev = Request.Form("rev")
ProjectName = Request.Form("projname")
ProjectEngineer = Request.Form("engr")

'set connection string
ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" &_

"DBQ=C:\Inetpub\wwwroot\Test_Engr_projects.mdb;DefaultDir=;UID=;PWD=;"


'create an ADO connection object
Set Connection = Server.CreateObject("ADODB.Connection")


'Connection.ConnectionTimeout = 30
'Connection.CommandTimeout = 80

Connection.Open ConnectionString

'execute the insert SQL
Connection.execute(SQLupdate1)
Connection.execute(SQLupdate2)
Connection.execute(SQLupdate3)
Connection.execute(SQLupdate4)

' Done. Close the connection object
connection.Close
Set connection = Nothing
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top