Hi I'm having a problem with adding records to a child table with ADO using
VB6 SP4. Here is the scenario
Table A has a one to one relationship with Table B, but Table B doesn't
always relate to a record in Table A (it is normalized.)
Table C and Table D have a many to one relationship with Table B.
Table A is user information.
Fields: Login Name.
Table B is the contact information.
Fields: First Name, Last Name.
Table C is the address.
Fields: Typical address fields.
Table D is the phone numbers.
Fields: Typical phone fields.
I have tried the data environment to create the parent child relationship,
manual recordsets with shape clauses and manual recordsets with select
queries. All of these methods display the data great it breaks down when I
try to add a new record to the child table.
I will drop Login Name, First Name, Last Name as text boxes, address and
phone I will drop as datagrids with addnew, delete, etc set to true.
Using the data environment and manual recordsets with shape clauses I can
change data in an existing record on any field but if in the grid I go to a
new line and type into a field the field blanks when I try to leave it.
I thought I would go back to the old way of doing it in VB5. I put 3 ADO
data controls onto the form, hooked the fields to the corresponding data
controls. I would then requery the data in the children when the parent
moved. The problem with this is that the requery causes the fields to lose
the connection to the data controls.
So the question is what am I missing. If a sample would help please e-mail
me and I will send it to you.
Thanks in advance for any help you can offer.