Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

VB6.0 and DB2

Visual Basic 4 / 5 / 6 vb6.0 ibmDB2

  • Please log in to reply
3 replies to this topic

#1 libbylibra

libbylibra

    CC Newcomer

  • Member
  • PipPip
  • 13 posts

Posted 28 August 2012 - 11:13 AM

Hi,

I'm currently using DB2 connecting VB6.0 for my project. I have connected the VB to DB2, and I can view all the data through VB.
But, when I was trying to add data to my tables in DB2 through VB, it appears the SQL Error -531, "PARENT KEY IN A PARENT ROW CANNOT BE UPDATED BECAUSE IT HAS ONE OR MORE DEPENDENT ROWS IN RELATIONSHIP"
Any idea on how to fix this?
Thanks!
  • 0

#2 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash

Posted 28 August 2012 - 12:10 PM

Sounds like you are changing a foreign key for another table.
  • 0
My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth

#3 libbylibra

libbylibra

    CC Newcomer

  • Member
  • PipPip
  • 13 posts

Posted 28 August 2012 - 12:47 PM

but then i just input data into 1 table only, didnt do any changes to it.
hmmm...
  • 0

#4 lespauled

lespauled

    CC Leader

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1360 posts
  • Programming Language:C, C++, C#, JavaScript, PL/SQL, Delphi/Object Pascal, Visual Basic .NET, Pascal, Transact-SQL, Bash

Posted 29 August 2012 - 04:46 AM

You have to find the foreign key relationships between that table and other tables. One of the columns must depend on another table's value. Thus, the restraint throws an exception.
  • 0
My Blog: http://forum.codecal...699-blog-77241/
"Women and Music: I'm always amazed by other people's choices." - David Lee Roth





Also tagged with one or more of these keywords: Visual Basic 4 / 5 / 6, vb6.0, ibmDB2

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download