Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update recordset error Help !!

Status
Not open for further replies.

unicorn11

Programmer
Jun 10, 2000
392
IN
Product Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6001<br>Product Name&nbsp;&nbsp;&nbsp;Peach Snappes 750ml <br>Rate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;420 <br>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>Image Path<br>Quantity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;750ml <br>Product Type&nbsp;&nbsp;&nbsp;7 <br><br>What i am trying to insert<br>the sql i am using<br>Insert into product_mst values (6001,'Peach Snappes 750ml',420,'','',750,7); <br><br>&nbsp;the error it is giving<br><br>Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br><br>[Microsoft][ODBC SQL Server Driver][SQL Server]An explicit value for<br>the identity column in table 'product_mst' can only be specified<br>&nbsp;when a column list is used and IDENTITY_INSERT is ON. <br>/rep/entered.asp, line 54 <br><br>What do i do so that i can solve that <p>Unicorn11<br><a href=mailto:webmaster@tripmedia.com>webmaster@tripmedia.com</a><br><a href= > </a><br>Hi there it all likeminded fellows!!!!!!
 
Dear Unicorn11,<br><br>Your column 'Product ID' is defined as an IDENTITY column in the table. Typically you do this when you want the database do handle assigning that column value for you when you insert a new row. This guarantees a unique value in that column for each row. So your sql statment should not try to set a value in that column.<br><br>Insert into product_mst (Product Name, Rate, Quantity, Product Type) values ('Peach Snappes 750ml',420,750,7)<br><br>If the 'Product ID' column is meant to contain a key that relates to another table then the column definition should not contain the 'IDENTITY' attribute.<br><br>Hope this helps<br>-pete<br>
 
thanks pete !<br><br>unicorn11<br><br>i will try it out <p>Unicorn11<br><a href=mailto:webmaster@tripmedia.com>webmaster@tripmedia.com</a><br><a href= > </a><br>Hi there it all likeminded fellows!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top