add info to database with a form

S

Stu

I'm using some asp code and a form to add information to a
database. here is the form code:

<FORM METHOD="POST" action="addtrack.asp">
<TABLE BORDER="1" WIDTH="100%">
<TR>
<TD WIDTH="30%">Shipment Tracking Number</TD>
<TD WIDTH="70%"><INPUT TYPE="text" NAME="tracknum"
SIZE="40" TABINDEX="1"></TD>
</TR>
<TR>
<TD WIDTH="30%">Sales Order Number</TD>
<TD WIDTH="70%"><INPUT TYPE="text" NAME="son"
SIZE="40" TABINDEX="2"></TD>
</TR>
<TR>
<TD WIDTH="30%">Company</TD>
<TD WIDTH="70%"><INPUT TYPE="text" NAME="company"
SIZE="20" TABINDEX="3"></TD>
</TR>
<TR>
<TD WIDTH="30%" VALIGN="top">Tracking Info.</TD>
<TD WIDTH="70%" VALIGN="top"><TEXTAREA ROWS="4"
NAME="tinfo" COLS="40" TABINDEX="4"></TEXTAREA></TD>
</TR>
<TR>
<TD WIDTH="30%">Weblink</TD>
<TD WIDTH="70%"><INPUT TYPE="text" NAME="weblink"
SIZE="20" TABINDEX="5"></TD>
</TR>
<TR>
<TD WIDTH="30%"><INPUT TYPE="submit" VALUE="Submit"
NAME="B1" TABINDEX="6"><INPUT TYPE="reset" VALUE="Reset"
NAME="B2" TABINDEX="7"></TD>
<TD WIDTH="70%">&nbsp;</TD>
</TR>
</TABLE>
</FORM>

and here is the asp page that it posts to:

<%
tracknum = Request.QueryString("tracknum")
son = Request.QueryString("son")
company = Request.QueryString("company")
tinfo = Request.QueryString("tinfo")
weblink = Request.QueryString("weblink")

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=C:mypath\mydatabase.mdb"

ADD = "INSERT INTO shipping (tracknum, son, company,
tinfo, weblink) VALUES ('"& tracknum &"','"& son &"','"&
company &"','"& tinfo &"','"& weblink &"')"
Conn.Execute( ADD)

shipping = "SELECT * FROM shipping ORDER BY ID"
Set shipping = Conn.Execute(shipping)



%>
<%
shipping.close

response.redirect("track_entry.htm")
%>

The Problem I'm having, is when I fill in the form and
submit it, it makes a new record in the database, but it
doesnt' add any of the information that i filled out in
the form. Just adds the auto ID number and doesnt' add
the text i typed in. What am I doing wrong?
 
T

Tom Gahagan

WAG......

Try using request.form("my_field")

instead of Request.QuerySting() ????

Best to you.......
Tom Gahagan
 

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