473,322 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

problem in adding record to Access datbase

omerbutt
638 512MB
ih i have made an ASP page on which i am getting the values from a FORM and i am inserting those values into the AccessDatabase but the problem is that it is inserting each entry twice can any 1 help me out of this prob :(,,,,,,here is the code
Expand|Select|Wrap|Line Numbers
  1. <%
  2.     codeno=Request("code_no")
  3.     partno=Request("prt_no")
  4.     product=Request("prd")
  5.     brand=Request("brand")
  6.     auto=Request("auto")
  7.     unitprice=Request("unit_price")
  8.     size=Request("size")
  9.     height=Request("height")
  10.     outd1=Request("out_d1")
  11.     outd2=Request("out_d2")
  12.     ind1=Request("in_d1")
  13.     ind2=Request("in_d2")
  14.     trepno=Request("t_rep")
  15.     rpno1=Request("rp_no1")
  16.     rpno2=Request("rp_no2")
  17.     rpno3=Request("rp_no3")
  18.     rpno4=Request("rp_no4")
  19.     rpno5=Request("rp_no5")
  20.     rpno6=Request("rp_no6")
  21.  
  22.  
  23. Dim Connstr, ADSTK, strSQL
  24.  
  25. set ADSTK=Server.CreateObject("ADODB.Recordset")        
  26. Connstr="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("db/db1.mdb")
  27.  
  28. strSQL = "Select Stk_items.Code_no, Stk_items.Prt_no, Stk_items.Prd, Stk_items.Brand, Stk_items.Auto, Stk_items.U_price, Stk_items.Size, Stk_items.Height, Stk_items.O_d1, Stk_items.O_d2, Stk_items.I_d1, Stk_items.I_d2, Stk_items.T_rep_no, Stk_items.Rep1, Stk_items.Rep2, Stk_items.Rep3, Stk_items.Rep4, Stk_items.Rep5, Stk_items.Rep6 From Stk_items;"
  29.  
  30. ADSTK.CursorType = 2
  31. ADSTK.LockType = 3    
  32.  
  33. ADSTK.Open strSQL, Connstr, 2
  34. ADSTK.AddNew    
  35.  
  36. ADSTK.Fields("Code_no")=codeno
  37. ADSTK.Fields("Prt_no")=partno
  38. ADSTK.Fields("Prd")=product
  39. ADSTK.Fields("Brand")=brand
  40. ADSTK.Fields("Auto")=auto
  41. ADSTK.Fields("U_price")=unitprice
  42. ADSTK.Fields("Size")=size
  43. ADSTK.Fields("Height")=height
  44. ADSTK.Fields("O_d1")=outd1
  45. ADSTK.Fields("O_d2")=outd2
  46. ADSTK.Fields("I_d1")=ind1
  47. ADSTK.Fields("I_d2")=ind2
  48. ADSTK.Fields("T_rep_no")=trepno
  49. ADSTK.Fields("Rep1")=rpno1
  50. ADSTK.Fields("Rep2")=rpno2
  51. ADSTK.Fields("Rep3")=rpno3
  52. ADSTK.Fields("Rep4")=rpno4
  53. ADSTK.Fields("Rep5")=rpno5
  54. ADSTK.Fields("Rep6")=rpno6    
  55.  
  56. ADSTK.Update
  57. ADSTK.Close
  58.  
  59. set ADSTK = Nothing
  60. set Connstr = Nothing
  61. Response.Redirect("Ad_stk.asp")
  62. %>
  63.  
Nov 25 '07 #1
0 1053

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: smita | last post by:
Hi, I have an xml file as below <root> <table id =1> <user>abc</user> <age>25</age> </table> <table id = 2> <user>xyz</user>
2
by: RipTide | last post by:
Background: Using an unsupported/abandoned multi-user multi-database program that uses Access 97 and Jet 3.5. Program itself appears to have been built with PowerBuilder 6.5. Databases reside on...
6
by: S. Graefner | last post by:
Hello Folks, I'm a Relitive newbie to the blood sport of MS ACCESS. I have designed and built a database with multiple, Related, tables. The db works well, more by good luck then good planing I...
8
by: Bri | last post by:
Greetings, I'm having a very strange problem in an AC97 MDB with ODBC Linked tables to SQL Server 7. The table has an Identity field and a Timestamp field. The problem is that when a new record...
1
by: Terry | last post by:
Hello, Has anyone experienced the following problem following an Upsize from Access 97 to SQL 2000 using the MS Upsize Wizard? Or can anyone see what the problem might be. Before Upsize...
7
by: Zachary Hilbun | last post by:
The below is some test code to help me learn how to update a dataset. It is supposed to read the value of UserCounter and write it back. The UserCounter is being read correctly as 0, is 1 when...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
17
by: radio1 | last post by:
Configuration: Access 2002 and SQL Server 2000 using a .ADP Project. I would VERY MUCH appreciate anyone's input into this problem I'm having. I have a form in Access that does not permit...
1
by: Sagaert Johan | last post by:
Hi When i add a datacolumn to a dataset and then call Update on the dataset then my MS Access datbase does not reflect the changes.(no coumn was added to the table) DataColumn newcolumn =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.