a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

passing parameters and inserting into new table in database

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> passing parameters and inserting into new table in database
Page: [1]
 
slimswol

 

Posts: 22
Joined: 3/25/2003
Status: offline

 
passing parameters and inserting into new table in data... - 3/25/2003 19:11:21   
Hi,
I have set up a ordering system for shirts. All the shirt information is in a database and is displayed with pictures. The user can then click on a link and the ProductID information is passed to the next page which will gather all ordering info (quantity, color, size, name, etc). In this page I have some info freom the database displayed. The rest is for the user to input in the form. That is where I am stuck at. When I fill out the form I get this error message:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
Number: -2147217913 (0x80040E07)
Source: Microsoft OLE DB Provider for ODBC Drivers

One or more form fields were empty. You should provide default values for all form fields that are used in the query.


My SQL query is for the next page (to update the table) is:
INSERT INTO " Orders Table" (EmployeeID, FirstName, LastName, Color, Size_Price, Quantity, DebitAccount, AccountNumber, PayrollDeduction, Increments) VALUES (' ::EmployeeID::' , ' ::FirstName::' , ' ::LastName::' , ' ::Color::' , ' ::Size_Price::' , ::Quantity::, ' ::DebitAccount::' , ' ::AccountNumber::' , ' ::PayrollDeduction::' , ' ::Increments::' )

I am also passing these fields to the update page:
1)DatePlaced = <%= FormatDateTime(Now)%>
2)ProductID = <%=ProductID%>

Does anyone know what the problem could be?
Thanks!
EE

 

Posts: 8
Joined: 1/21/2002
From: Orlando FL USA
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/25/2003 20:55:56   
If you are allowing the user to not fill out all of the fields then you will need to check the field values before executing your insert statement and if the user has not entered a value for a field or fields then set the value = to ' ' .
Hope this helps.
E

(in reply to slimswol)
slimswol

 

Posts: 22
Joined: 3/25/2003
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/27/2003 10:40:12   
I' m not sure I understand what you are saying? Just to clarify, I this page has information from the previous page passed to it (ProductID, ProductName, ProductDescription, ProductColors, and Size_Price) The rest of the information on this page are text boxes that the user will input the information and this user information along with all the info that was passed to this page (see above) is sent to a database table.

Thanks

(in reply to slimswol)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/27/2003 10:48:33   
quote:

...VALUES (' ::EmployeeID::' , ...


Is EmplyeeID numeric? If so, remove the apostrophes:

...VALUES (::EmployeeID::,...

Just a guess - hope it helps...:)

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to slimswol)
slimswol

 

Posts: 22
Joined: 3/25/2003
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/27/2003 11:10:22   
Employee ID is actually intitials, so no its not numeric.
Thanks for trying though!

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/27/2003 13:44:01   
Can you Response.write and post the actual query with data?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to slimswol)
slimswol

 

Posts: 22
Joined: 3/25/2003
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/27/2003 14:35:39   
Here is both pages, maybe that will help: First page is with all info and user input. Second is the " Insert" page. 1st Called buy.asp, second called buy.asp:
BUY.ASP
<html>

<head>
<meta http-equiv=" Content-Language" content=" en-us" >
<meta name=" GENERATOR" content=" Microsoft FrontPage 5.0" >
<meta name=" ProgId" content=" FrontPage.Editor.Document" >
<meta http-equiv=" Content-Type" content=" text/html; charset=windows-1252" >
<title>New Page 1</title>
</head>

<body>

<table border=" 0" cellpadding=" 0" cellspacing=" 0" style=" border-collapse: collapse" bordercolor=" #111111" width=" 100%" height=" 89" >
<tr>
<td width=" 52%" bgcolor=" #666699" height=" 1" colspan=" 2" ><font color=" #FFFFFF" ><font face=" Arial" size=" 4" >
<a href=" index.htm" ><font color=" #FFFFFF" >CU West Online Shirt Orders</font></a><br>
</font><font face=" Arial" size=" 2" >Welcome to our online store!</font></font></td>
<td width=" 48%" bgcolor=" #666699" height=" 1" colspan=" 2" >
<img border=" 0" src=" cuwest.jpg" align=" right" ></td>
</tr>
<tr>
<td width=" 26%" bgcolor=" #C0C0C0" height=" 1" >
<p align=" center" ><b><font face=" Arial" size=" 2" >Welcome to our online
store!</font></b></td>
<td width=" 26%" bgcolor=" #C0C0C0" height=" 1" >
<p align=" right" ><b><a href=" mens.asp" ><font color=" #FFFFFF" face=" Arial" >
Men</font></a><font color=" #FFFFFF" face=" Arial" > </font></b></td>
<td width=" 24%" bgcolor=" #C0C0C0" height=" 1" >
<p align=" right" ><b><font face=" Arial" color=" #FFFFFF" >
<a href=" womens.asp" >
<font color=" #FFFFFF" >Women</font></a></font></b></td>
<td width=" 24%" bgcolor=" #C0C0C0" height=" 1" > </td>
</tr>
</table>


<table>
</table>
<!--webbot bot=" DatabaseRegionStart" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-columntypes=" 202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202" s-dataconnection=" corporate_shirts" b-tableformat=" FALSE" b-menuformat=" FALSE" s-menuchoice s-menuvalue b-tableborder=" FALSE" b-tableexpand=" FALSE" b-tableheader=" FALSE" b-listlabels=" FALSE" b-listseparator=" TRUE" i-listformat=" 0" b-makeform=" FALSE" s-recordsource=" Product Details" s-displaycolumns=" ProductID,ProductName,ProductDescription,Gender,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-criteria=" [ProductID] EQ {ProductID} +" s-order s-sql=" SELECT * FROM " Product Details" WHERE (ProductID = ' ::ProductID::' )" b-procedure=" FALSE" clientside suggestedext=" asp" s-defaultfields=" ProductID=" s-norecordsfound=" No records returned." i-maxrecords=" 256" i-groupsize=" 0" botid=" 0" u-dblib=" ../_fpclass/fpdblib.inc" u-dbrgn1=" ../_fpclass/fpdbrgn1.inc" u-dbrgn2=" ../_fpclass/fpdbrgn2.inc" tag=" BODY" preview=" <table border=0 width=" 100%" ><tr><td bgcolor=" #FFFF00" align=" left" ><font color=" #000000" >This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.</font></td></tr></table>" startspan --><!--#include file=" ../_fpclass/fpdblib.inc" -->
<% if 0 then %>
<SCRIPT Language=" JavaScript" >
document.write(" <div style=' background: yellow; color: black;' >The Database Results component on this page is unable to display database content. The page must have a filename ending in ' .asp' , and the web must be hosted on a server that supports Active Server Pages.</div>" );
</SCRIPT>
<% end if %>
<%
fp_sQry=" SELECT * FROM " " Product Details" " WHERE (ProductID = ' ::ProductID::' )"
fp_sDefault=" ProductID="
fp_sNoRecords=" No records returned."
fp_sDataConn=" corporate_shirts"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=" "
fp_sMenuValue=" "
fp_iDisplayCols=18
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file=" ../_fpclass/fpdbrgn1.inc" -->
<!--webbot bot=" DatabaseRegionStart" endspan i-checksum=" 41065" --><form method=" POST" action=" buy1.asp" onsubmit=" return FrontPage_Form1_Validator(this)" language=" JavaScript" name=" FrontPage_Form1" >
<table border=" 0" cellpadding=" 0" cellspacing=" 0" style=" border-collapse: collapse" bordercolor=" #111111" width=" 100%" height=" 284" >
<tr>
<td width=" 22%" height=" 48" > </td>
<td width=" 57%" height=" 48" colspan=" 4" >
<p align=" center" ><font face=" Arial" size=" 2" ><b>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductName" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductName<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductName" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 30557" --><br>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductDescription" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductDescription<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductDescription" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 58443" --><br>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductID" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductID<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductID" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 17683" --></b></font></td>
<td width=" 71%" height=" 48" > </td>
</tr>
<tr>
<td width=" 22%" height=" 203" rowspan=" 2" >
<img border=" 0" src=" images/<%=FP_FieldLink(fp_rs," Photo" )%>" width=" 141" height=" 169" ></td>
<td width=" 25%" height=" 96" colspan=" 2" ><font size=" 2" face=" Arial" >Quantity:
</font><font face=" Arial" >
<!--webbot bot=" Validation" s-data-type=" Number" s-number-separators=" ,." --><input type=" text" name=" Quantity" size=" 6" ></font></td>
<td width=" 18%" height=" 203" rowspan=" 2" >
<p align=" left" ><font face=" Arial" size=" 2" ><b>         
<u>Colors:</u></b> <br>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductColor1" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductColor1<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductColor1" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 35967" --> 
<br>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductColor2" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductColor2<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductColor2" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 35971" --><br>
</font>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductColor3" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductColor3<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductColor3" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 35975" --><br>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductColor4" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductColor4<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductColor4" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 35979" --><br>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductColor5" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductColor5<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductColor5" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 35983" --><br>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductColor6" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductColor6<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductColor6" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 35987" --><br>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductColor7" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductColor7<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductColor7" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 35991" --><br>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductColor8" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductColor8<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductColor8" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 35995" --><br>
<!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" ProductColor9" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>ProductColor9<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," ProductColor9" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 35999" --></td>
<td width=" 14%" height=" 203" rowspan=" 2" ><font face=" Arial" size=" 2" ><b>
Select Color:<font color=" #FF0000" ><br>
</font></b></font>
<font color=" #FF0000" face=" Arial" style=" font-size: 8pt" >* Copy and paste
selection from left.</font><p><input type=" text" name=" Color" size=" 15" ></p>
<p> </p>
<p> </td>
<td width=" 71%" height=" 203" rowspan=" 2" >
<p align=" center" >
<img border=" 0" src=" images/<%=FP_FieldLink(fp_rs," Photo1" )%>" width=" 135" height=" 178" ></td>
</tr>
<tr>
<td width=" 14%" height=" 107" ><b><font face=" Arial" size=" 2" >Size/Prices:</font></b><font color=" #FF0000" face=" Arial" style=" font-size: 9pt" ><br>
</font><b><font face=" Arial" size=" 2" >SMLXL:</font></b><font face=" Arial" size=" 2" ><!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" SMLXL" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>SMLXL<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," SMLXL" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 4945" --><br>
</font><b><font face=" Arial" size=" 2" >2XL:</font></b><font face=" Arial" size=" 2" ><!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" 2XL" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>2XL<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," 2XL" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 64737" --><br>
</font><b><font face=" Arial" size=" 2" >3XL:</font></b><font face=" Arial" ><font size=" 2" ><!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" 3XL" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>3XL<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," 3XL" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 64801" --><br>
</font><b><font size=" 2" >4XL:</font></b><font size=" 2" ><!--webbot bot=" DatabaseResultColumn" s-columnnames=" ProductID,ProductName,ProductDescription,Gender,Photo,Photo1,ProductColor1,ProductColor2,ProductColor3,ProductColor4,ProductColor5,ProductColor6,ProductColor7,ProductColor8,ProductColor9,SMLXL,2XL,3XL,4XL" s-column=" 4XL" b-tableformat=" FALSE" b-hashtml=" FALSE" b-makelink=" FALSE" clientside b-MenuFormat preview=" <font size=" -1" >&lt;&lt;</font>4XL<font size=" -1" >&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs," 4XL" )%><!--webbot bot=" DatabaseResultColumn" endspan i-checksum=" 64865" --><br>
<br>
<br>
</font></font></td>
<td width=" 11%" height=" 107" ><b><font face=" Arial" size=" 2" >Select
Size/Price:<br>
</font></b><font color=" #FF0000" face=" Arial" style=" font-size: 8pt" >*
Copy and paste selection from left.</font><br>
<input type=" text" name=" Size_Price" size=" 11" ><p> </td>
</tr>
</table>
<table border=" 0" cellpadding=" 0" cellspacing=" 0" style=" border-collapse: collapse" bordercolor=" #111111" width=" 100%" height=" 188" >
<tr>
<td width=" 57%" colspan=" 3" bgcolor=" #666699" height=" 19" >
<p align=" right" ><u><b><font face=" Arial" size=" 3" color=" #FFFFFF" >
<span style=" background-color: #666699" >Payment Information</span></font></b></u></td>
<td width=" 43%" bgcolor=" #666699" height=" 19" > </td>
</tr>
<tr>
<td width=" 39%" colspan=" 2" height=" 22" ><b><font face=" Arial" size=" 2" >Debit from your account?</font></b></td>
<td width=" 18%" height=" 22" >
<p align=" left" >Yes <input type=" radio" value=" Yes" name=" DebitAccount" ></td>
<td width=" 43%" height=" 22" > No
<input type=" radio" name=" DebitAccount" value=" No" ></td>
</tr>
<tr>
<td width=" 39%" colspan=" 2" height=" 22" ><li>If selected Yes, what is your account number?</td>
<td width=" 18%" height=" 22" ><input type=" text" name=" AccountNumber" size=" 16" ></td>
<td width=" 43%" height=" 22" > </td>
</tr>
<tr>
<td width=" 39%" colspan=" 2" height=" 21" ><b><font face=" Arial" size=" 2" >Payroll deductions?</font></b></td>
<td width=" 18%" height=" 21" >Yes
<input type=" radio" name=" PayrollDeduction" value=" Yes" ></td>
<td width=" 43%" height=" 21" > No
<input type=" radio" name=" PayrollDeduction" value=" No" ></td>
</tr>
<tr>
<td width=" 39%" colspan=" 2" height=" 22" ><li>If yes, please select number of payments:</td>
<td width=" 18%" height=" 22" >
<!--webbot bot=" Validation" b-disallow-first-item=" TRUE" --><select size=" 1" name=" Increments" >
<option selected>Select One...</option>
<option>N/A</option>
<option>1 Pay Cycle</option>
<option>2 Pay Cycles</option>
<option>4 Pay Cycles</option>
<option>6 Pay Cycles</option>
</select></td>
<td width=" 43%" height=" 22" > </td>
</tr>
<tr>
<td width=" 57%" bgcolor=" #666699" colspan=" 3" height=" 19" >
<p align=" right" ><u><b><font face=" Arial" color=" #FFFFFF" >Personal
Information</font></b></u></td>
<td width=" 43%" bgcolor=" #666699" height=" 19" > </td>
</tr>
<tr>
<td width=" 16%" height=" 22" >ID (initials):</td>
<td width=" 23%" height=" 22" ><input type=" text" name=" EmployeeID" size=" 8" ></td>
<td width=" 18%" height=" 22" > </td>
<td width=" 43%" height=" 22" > </td>
</tr>
<tr>
<td width=" 18%" height=" 22" >First Name:</td>
<td width=" 21%" height=" 22" ><input type=" text" name=" FirstName" size=" 20" ></td>
<td width=" 18%" height=" 22" > </td>
<td width=" 43%" height=" 22" > </td>
</tr>
<tr>
<td width=" 18%" height=" 19" >Last Name:</td>
<td width=" 21%" height=" 19" ><input type=" text" name=" LastName" size=" 20" ></td>
<td width=" 18%" height=" 19" > </td>
<td width=" 43%" height=" 19" > </td>
</tr>
</table>
<p align=" center" >
<input type=" submit" value=" Buy Now!" name=" B1" style=" color: #FFFFFF; border: 1px solid #C0C0C0; background-color: #666699" ></p>
<input type=" hidden" name=" DatePlaced" value=" <%= FormatDateTime(Now)%>" >
<input type=" hidden" name=" ProductID" value=" <%=FP_FieldHTML(fp_rs," ProductID" )%>" >
</form>
<!--webbot bot=" DatabaseRegionEnd" b-tableformat=" FALSE" b-menuformat=" FALSE" u-dbrgn2=" ../_fpclass/fpdbrgn2.inc" i-groupsize=" 0" clientside tag=" BODY" preview=" <table border=0 width=" 100%" ><tr><td bgcolor=" #FFFF00" align=" left" ><font color=" #000000" >This is the end of a Database Results region.</font></td></tr></table>" startspan --><!--#include file=" ../_fpclass/fpdbrgn2.inc" -->
<!--webbot bot=" DatabaseRegionEnd" endspan i-checksum=" 56926" --></body></html>

HERE IS THE SECOND PAGE....which just inserts all the info from last page...
<html>

<head>
<meta name=" GENERATOR" content=" Microsoft FrontPage 5.0" >
<meta name=" ProgId" content=" FrontPage.Editor.Document" >
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = " windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv=" Content-Type" content=" text/html; charset=windows-1252" >
<title>New Page 1</title>
</head>

<body>

<table height=" 65" >
<tbody><br>
<!--webbot bot=" DatabaseRegionStart" s-columnnames s-columntypes s-dataconnection=" corporate_shirts" b-tableformat=" TRUE" b-menuformat=" FALSE" s-menuchoice s-menuvalue b-tableborder=" FALSE" b-tableexpand=" FALSE" b-tableheader=" FALSE" b-listlabels=" TRUE" b-listseparator=" TRUE" i-listformat=" 0" b-makeform=" FALSE" s-recordsource s-displaycolumns s-criteria s-order s-sql=" INSERT INTO &quot;Orders Table&quot; (EmployeeID, FirstName, LastName, Color, Size_Price, Quantity, DebitAccount, AccountNumber, PayrollDeduction, Increments) VALUES (' ::EmployeeID::' , ' ::FirstName::' , ' ::LastName::' , ' ::Color::' , ' ::Size_Price::' , ::Quantity::, ' ::DebitAccount::' , ' ::AccountNumber::' , ' ::PayrollDeduction::' , ' ::Increments::' )" b-procedure=" FALSE" clientside suggestedext=" asp" s-defaultfields=" EmployeeID=&amp;FirstName=&amp;LastName=&amp;Color=&amp;Size_Price=&amp;Quantity=&amp;DebitAccount=&amp;AccountNumber=&amp;PayrollDeduction=&amp;Increments=" s-norecordsfound=" No records returned." i-maxrecords=" 256" i-groupsize=" 0" botid=" 0" u-dblib=" ../_fpclass/fpdblib.inc" u-dbrgn1=" ../_fpclass/fpdbrgn1.inc" u-dbrgn2=" ../_fpclass/fpdbrgn2.inc" tag=" TBODY" preview=" <tr><td colspan=64 bgcolor=" #FFFF00" align=" left" width=" 100%" ><font color=" #000000" >This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.</font></td></tr>" b-WasTableFormat=" TRUE" startspan --><!--#include file=" ../_fpclass/fpdblib.inc" -->
<% if 0 then %>
<SCRIPT Language=" JavaScript" >
document.write(" <div style=' background: yellow; color: black;' >The Database Results component on this page is unable to display database content. The page must have a filename ending in ' .asp' , and the web must be hosted on a server that supports Active Server Pages.</div>" );
</SCRIPT>
<% end if %>
<%
fp_sQry=" INSERT INTO " " Orders Table" " (EmployeeID, FirstName, LastName, Color, Size_Price, Quantity, DebitAccount, AccountNumber, PayrollDeduction, Increments) VALUES (' ::EmployeeID::' , ' ::FirstName::' , ' ::LastName::' , ' ::Color::' , ' ::Size_Price::' , ::Quantity::, ' ::DebitAccount::' , ' ::AccountNumber::' , ' ::PayrollDeduction::' , ' ::Increments::' )"
fp_sDefault=" EmployeeID=&FirstName=&LastName=&Color=&Size_Price=&Quantity=&DebitAccount=&AccountNumber=&PayrollDeduction=&Increments="
fp_sNoRecords=" <tr><td colspan=16 align=left width=" " 100%" " >No records returned.</td></tr>"
fp_sDataConn=" corporate_shirts"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=" "
fp_sMenuValue=" "
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file=" ../_fpclass/fpdbrgn1.inc" -->
<!--webbot bot=" DatabaseRegionStart" endspan i-checksum=" 20193" --><!--webbot bot=" DatabaseRegionEnd" b-tableformat=" TRUE" b-menuformat=" FALSE" u-dbrgn2=" ../_fpclass/fpdbrgn2.inc" i-groupsize=" 0" clientside tag=" TBODY" preview=" <tr><td colspan=64 bgcolor=" #FFFF00" align=" left" width=" 100%" ><font color=" #000000" >This is the end of a Database Results region.</font></td></tr>" startspan --><!--#include file=" ../_fpclass/fpdbrgn2.inc" -->
<!--webbot bot=" DatabaseRegionEnd" endspan i-checksum=" 56926" --></tbody>
</table>

<p align=" center" ><b><font face=" Arial" >Thank you for your order.  </font>
</b></p>
<p align=" center" ><font face=" Arial" >If you have any further questions please
contact Laurie Dunn at 3416</font></p>

</body>

</html>


I appreciate all the help


(in reply to rdouglass)
Spooky

 

Posts: 26617
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/27/2003 15:02:48   
Are you populating all of the form fields?
It would probably make the last page easier to troubleshoot if it was on the Spooky diet, itll make writing the SQL a little easier. CAn you do that for us?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to slimswol)
slimswol

 

Posts: 22
Joined: 3/25/2003
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/27/2003 15:48:12   
I am having the users populate most of the fields on this page. There are a few fields that will not be filled out, just passed to database. These three fields (ProductID, ProductName, and ProductDescription) were " passed" from the previous page which let users view the products. These three fields from another table (Product Details) still need to be inserted into this new table (Order Details). Also, there are multiple colors and " size_price" fields. So each on of these fields are also passed to this page and displayed. Then the user will type the color and Size/Price they want. Here is the code on the second page with your spooky diet:

<html>

<head>
<title>New Page 1</title>
</head>
<body>

<table height=" 65" >
<tbody><br>
<!--#include file=" ../_fpclass/fpdblib.inc" -->
<% if 0 then %>
<SCRIPT Language=" JavaScript" >
document.write(" <div style=' background: yellow; color: black;' >The Database Results component on this page is unable to display database content. The page must have a filename ending in ' .asp' , and the web must be hosted on a server that supports Active Server Pages.</div>" );
</SCRIPT>
<% end if %>
<%
fp_sQry=" UPDATE " " Orders Table" " SET EmployeeID=' ::EmployeeID::' , FirstName=' ::FirstName::' , LastName=' ::LastName::' , ProductName=' ::ProductName::' ,ProductDescription=' ::ProductDescription::' , Color=' ::Color::' , Size_Price=' ::Size_Price::' , Quantity=::Quantity::, DebitAccount=' ::DebitAccount::' , AccountNumber=' ::AccountNumber::' , PayrollDeduction=' ::PayrollDeduction::' , Increments=' ::Increments::' Where ProductID=::ProductID::"
fp_sDefault=" EmployeeID=&FirstName=&LastName=&ProductName=&ProductDescription=&Color=&Size_Price=&Quantity=&DebitAccount=&AccountNumber=&PayrollDeduction=&Increments=&ProductID="
fp_sNoRecords=" <tr><td colspan=16 align=left width=" " 100%" " >No records returned.</td></tr>"
fp_sDataConn=" corporate_shirts"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=" "
fp_sMenuValue=" "
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file=" ../_fpclass/fpdbrgn1.inc" -->
</tbody>
</table>

<p align=" center" ><b><font face=" Arial" >Thank you for your order.  </font>
</b></p>

</body>

</html>

(in reply to Spooky)
slimswol

 

Posts: 22
Joined: 3/25/2003
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/28/2003 14:09:07   
Ok...so now I edited a few things on this page and it now shows this error message:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ' DatePlaced = 3/28/2003 11:46:04 AM' .
Number: -2147217900 (0x80040E14)
Source: Microsoft OLE DB Provider for ODBC Drivers

I looked up this error message and it said to make sure there are default values for autonumber and number fields. I have done this! I am not sure if I am closer to getting this right or not, but I did change the error message. haha.

Any suggestions?
Thanks

(in reply to slimswol)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/28/2003 14:16:49   
Hope I' m not messing you up by stepping into the middle...:)

If DatePlaced is a date/time field in Access, your UPDATE query needs to use the # as a delimiter instead of ' .

....DatePlaced=#::DatePlaced ::#,....

instead of:

....DatePlaced=' ::DatePlaced ::' ,....

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to slimswol)
slimswol

 

Posts: 22
Joined: 3/25/2003
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/28/2003 15:12:19   
You were right the date was....DatePlaced=#::DatePlaced ::#,....

instead of:

....DatePlaced=' ::DatePlaced ::' ,....

I changed this and now I am getting this error. I' m not sure what' s wrong with the INTO statement though.

Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
Number: -2147217900 (0x80040E14)
Source: Microsoft OLE DB Provider for ODBC Drivers

One or more form fields were empty. You should provide default values for all form fields that are used in the query.

Here is my SQL:
INSERT INTO " Orders Table" (OrderID, EmployeeID, ProductID, ProductName, ProductDescription, FirstName, LastName, Color, Size_Price, Quantity, DebitAccount, AccountNumber, PayrollDeduction, Increments, DatePlaced) VALUES (::OrderID::, ' ::EmployeeID::' , ' ::ProductID::' , ' ::ProductName::' , ' ::ProductDescription::' , ' ::FirstName::' , ' ::LastName::' , ' ::Color::' , ' ::Size_Price::' , ::Quantity::, ' ::DebitAccount::' , ' ::AccountNumber::' , ' ::PayrollDeduction::' , ' ::Increments::' , #::DatePlaced::#)

Thanks

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/28/2003 15:23:16   
quote:

INSERT INTO " Orders Table" (OrderID,


Is OrderID a Primary Key field? (or Autogenerated?) You cannot INSERT any PK field data. If that is the case, remove OrderID references and try again....:)

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to slimswol)
slimswol

 

Posts: 22
Joined: 3/25/2003
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/28/2003 15:27:30   
Ok that was a PK field. I took that off and I' m back to this error:
Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query expression ' #DatePlaced = 3/28/2003 1:09:44 PM#' .
Number: -2147217900 (0x80040E14)
Source: Microsoft OLE DB Provider for ODBC Drivers

One or more form fields were empty. You should provide default values for all form fields that are used in the query.

hmmm...??

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/28/2003 15:35:43   
I' m sorry I have to ask this again...:)...what is the Field Type of DatePlaced in the DB? In general if the field type is:

Text use ' ::fieldName::'
Numeric use ::fieldName::
Date/Time use #::fieldName::#

Ensure all your field types match the format of the SQL string (and vice versa). I' ve spent a lot of time before ' wandering around' when my field types were incorrect. Don' t want you to do the same....:)[:' (]

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to slimswol)
slimswol

 

Posts: 22
Joined: 3/25/2003
Status: offline

 
RE: passing parameters and inserting into new table in ... - 3/28/2003 15:37:27   
I figured out why I was getting that error, it was because I typed the hidden field info wrong. I fixed it and now I am getting this error message: Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
Number: -2147217913 (0x80040E07)
Source: Microsoft OLE DB Provider for ODBC Drivers

I thought I fixed this problem already, but maybe I' m just going in circles here.

I' ve never had so many problems with something like this.

(in reply to slimswol)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: passing parameters and inserting into new table in ... - 4/2/2003 9:42:18   
Sorry, been away but I haven' t given up. Are you still working on this and if so, where is the project at?

And if you' ve put the code on a Spooky Diet, can you somewhere inside the DRW place this code?

response.write fp_sQry

so that the DRW looks something like:

....
BOTID=0
fp_iRegion=BOTID
response.write fp_sQry
%>
<!--#include file=" _fpclass/fpdbrgn1.inc" -->
....

See IMO what would really help right now is to see the actual SQL string (with data). Hope fully with this code we can accomplish that....

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to slimswol)
Spooky

 

Posts: 26617
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: passing parameters and inserting into new table in ... - 4/2/2003 14:59:28   
quote:

' #DatePlaced = 3/28/2003 1:09:44 PM#' ?


" DatePlaced =" should not be within the delimiters. Is this being passed from an original form? only the date should be passed.
Can you write the SQL as we have mentioned?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to slimswol)
slimswol

 

Posts: 22
Joined: 3/25/2003
Status: offline

 
RE: passing parameters and inserting into new table in ... - 4/11/2003 13:42:40   
Unfortunately, I gave up with setting up this page the way I wanted it. So I set it up the way I knew would work, which was with the database info that was passed from the last page on the top of the page and the form separate and below that. So now, unfortunately the user has to input the ProductID and then its sent to the other table (OrderDetails). What I wanted to do is have the ProductID added in there for the user and maybe have a drop down list of the colors and sizes that are populated from the database too. But I still would like to upgrade this to the way I want it eventually.
Let me know what you think

(in reply to Spooky)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> passing parameters and inserting into new table in database
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts