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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using ASP to insert new record in sql db table

Status
Not open for further replies.

ToddF

Programmer
Oct 17, 2002
5
US
When I use the excute property of the connection object on an asp page to insert a new record into a sql table, it creates two records.

The key field "id" is a int field with Identity seed of 1.

The code I am using is
dcndb.Execute "insert into csc_workload_resp (userid,subject,sub_date,sub_row)" & _
" values('aa',1,getdate(),'ac')"

dcndb is the connection object.
 
Do I understand correctly? When you execute the statement one time, it inserts two rows in the same table with duplicate data execept the ID.

Are you sure it is only executed once? Have the DBA trace execution of the statement to confirm it is being executed only once.

Another possibility is a TRIGGER on the table that inserts another row. If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
Another possibility is that there is an error in the flow of your ASP code which is causing the statement to be executed twice.

ASP Forum:
forum333 --James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top