INSERT DUPLICATE KEY?? 
Author Message
 INSERT DUPLICATE KEY??

I hope there is a simple answer to this simple query
basically i have a datacombo linked to a sql table usign the following
basic code:

Set CN = New ADODB.Connection
CN.CursorLocation = adUseClient
CN.Open ("Provider=MSDASQL.1;Password=KRAKEN;Persist Security
Info=True;User ID=sa;Data Source=eEnterprises6;Initial Catalog=RCC")

Set RS2 = New ADODB.Recordset
RS2.Open "SELECT ITEMNMBR FROM IV00102 WHERE LOCNCODE = '' ORDER BY
ITEMNMBR", CN, adOpenStatic, adLockOptimistic
Set DataCombo1.DataSource = RS2
Set DataCombo1.RowSource = RS2
DataCombo1.DataField = "ITEMNMBR"
DataCombo1.ListField = "ITEMNMBR"

i can use the datacombo as i want, until i added movenext and
moveprevious cmd buttons
if i have used the datacombo to navigate to a record
then use the cmd button with the code
RS2.movenext
i get the follwoing message:
Run-time error '-2147217900(80040e14)':
[micrsoft][ODBC SQL Driver][SQL server]Violation of PRIMARY KEY
constraint 'PKIV00102'. Cannot insert duplicate key in object 'IV00102'.

i do not understand why i am gettign it as i am not updating or adding
records in any way
it will movenext or previous fine if i havent used the datacombo drop
down first?
can anyone clear this up for me?

ReN DOH!!!!

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Mon, 28 Jun 2004 19:15:40 GMT  
 INSERT DUPLICATE KEY??
HI
There is no error in your coding.

When you link your data bound control to a sql table and use MoveNext or
manually moving the record by clicking on the navigation buttons on the
ADO Data bound control will force an update.
It is a bug.

Harinatha Reddy Gorla
        Software Engineer
Smart Software Technologies,
Hyderabad, India

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Mon, 28 Jun 2004 21:15:51 GMT  
 INSERT DUPLICATE KEY??
oh wonderful
thanks for the info
i think i need a new plan then
cheers

ReN DOH!!!!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Tue, 29 Jun 2004 03:05:59 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB & Access: duplicate inserts on unique key

2. duplicate records inserted into access DB

3. no error when inserting duplicates into Access

4. rdo duplicate insert error

5. duplicate records inserted into access DB

6. After inserting 40 sub reports the sections is getting duplicated

7. Skip duplicate values in INSERT

8. Skip duplicate values in INSERT

9. INSERT INTO skipping duplicates

10. Error: Inserting duplicate rows in Oracle.

11. Inserting duplicate value

12. How to INSERT with duplicate records into Access 2000

 

 
Powered by phpBB® Forum Software