Current location: Hot Scripts Forums » Programming Languages » ASP » Problem with inserting values into an access db


Problem with inserting values into an access db

Reply
  #1 (permalink)  
Old 03-29-05, 11:57 AM
pinochio53 pinochio53 is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Problem with inserting values into an access db

I have a repeating table that has a form in it, and i want the values from the table to be inserted into an access table. here is a screenshot http://www.goofu.net/screen.jpg

I want it so that when you put in an amount it will add just that line to the database with the amount. they way i have it now it tries to add every single value from the whole table into the database, does anyone know how i can make it be restricted to just one line. i want it to only put that one line into the database.

below is the error i get when i try to do this.
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same.
/parts_db/project4/partpick.asp, line 115


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)

Page:
POST 16088 bytes to /parts_db/project4/partpick.asp

POST Data:
Inventory=ACTV1635&Description=RECEIVER%2C+OPTICAL +-+590812&PartNo=590812&Price=1597.67&amount=25&Requ est+ID=&Submit=Add&Inventory=ACTV8201&Description= TRANSMITTER%2CSGL+ISOLATED+UNCOOLED+DI STR+FEEDBA . . .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-29-05, 01:53 PM
koncept
Guest
 
Posts: n/a
Post

to do that, in the repeated section (before and after the <tr> </tr> tags) add the form tags

Code:
  <form>
  <tr>
  row 1
  </tr>
  </form>
   <form>
   <tr>
   row 2
   </tr>
   </form>
  ---
  
   <form>
   <tr>
   last row
   </tr>
   </form>
thats what it should look like when out puted

Code:
 <% do while not rs.eof %>
 <form action="add.asp">
 <tr>
 <td><%=rs("info1")%></td>
 <td><%=rs("info2")%></td>
 <td><%=rs("info3")%></td>
 </tr>
 </form>
 <%
   rs.movenext
   loop
 %>
actual code needed

that should solve your problem, just make sure you set the form action and other necessary properties

Last edited by koncept; 03-29-05 at 01:56 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Auto Dealer Script nuzzle PHP 17 04-14-10 09:34 PM
Asp and Microsoft Access 2002 problem gop373 ASP 2 10-06-04 10:13 AM
Can anyone help me ? (problem using php variables in html db insert code) chronic_ PHP 2 06-13-04 12:19 PM
Access Database Date Problem emvanlill Windows .NET Programming 2 05-10-04 04:06 AM
inserting sounds to DB mivec PHP 1 04-29-04 05:52 AM


All times are GMT -5. The time now is 12:38 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.