Solved

VB6 update SQL Server

Posted on 2009-05-20
2
204 Views
Last Modified: 2012-05-07
Processing an update statement is causing a Duplicate Key error inserting.... ?  Primary key error.  The primary key isn't a column being updated??
Update subscriptions set PRODUCT_CODE = 'ONLINE_LIB' , 

BT_ID = '100521' , 

PROD_TYPE = 'SUB' , 

STATUS = 'A' , 

BEGIN_DATE = '10/1/2008' , PAID_THRU = '9/30/2009' , COPIES = 1 , SOURCE_CODE = '' , FIRST_SUBSCRIBED = '12/31/1899' , CONTINUOUS_SINCE = '10/1/2008' , PRIOR_YEARS = 0 , FUTURE_COPIES = 0 , FUTURE_COPIES_DATE = '12/31/1899' , PREF_MAIL = 0 , PREF_BILL = 0 , RENEW_MONTHS = '0' , MAIL_CODE = '' , PREVIOUS_BALANCE = 0 , BILL_DATE = '10/2/2008' , REMINDER_DATE = '12/31/1899' , REMINDER_COUNT = '0' , BILL_BEGIN = '10/1/2008' , BILL_THRU = '9/30/2009' , BILL_AMOUNT = 300 , BILL_COPIES = 1 , PAYMENT_AMOUNT = 300 , PAYMENT_DATE = '10/2/2008' , PAID_BEGIN = '12/31/1899' , LAST_PAID_THRU = '9/30/2009' , COPIES_PAID = 1 , ADJUSTMENT_AMOUNT = 0 , LTD_PAYMENTS = 300 , ISSUES_PRINTED = '' , BALANCE = 0 , CANCEL_REASON = '' , YEARS_ACTIVE_STRING = '' , LAST_ISSUE = '' , LAST_ISSUE_DATE = '12/31/1899' , DATE_ADDED = '10/2/2008' , LAST_UPDATED = '10/3/2008 11:09:50 AM' , UPDATED_BY = 'KTRINH' , INTENT_TO_EDIT = '' , F

LAG = '' , BILL_TYPE = 'A' , COMPLIMENTARY = 0 , FUTURE_CREDITS = 0 , INVOICE_REFERENCE_NUM = 0 , INVOICE_LINE_NUM = 0 , CAMPAIGN_CODE = '' , APPEAL_CODE = '' , ORG_CODE = 'MCLE' , IS_FR_ITEM = 0 , FAIR_MARKET_VALUE = 0 Where  id = '100521'

Open in new window

0
Comment
Question by:Jeff_Kingston
2 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 250 total points
ID: 24432007
Hello Jeff_Kingston,

Are you updating a column that has a unique index, for which your update would introduce a duplicate value?

Regards,

Patrick
0
 

Author Comment

by:Jeff_Kingston
ID: 24432114
You ever been in the forest where you can't see the trees.  there was a field in the updatestring that was a primary key,that I completely forgot about.  Wouldn't it be nice if there error trapping contined the offending row???
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This collection of functions covers all the normal rounding methods of just about any numeric value.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now