Hopefully someone on this list can help me out.

Here is my problem.  I have a MS / SQL 2005 database accessed via ADO
using Delphi 6.  I am accessing the tables via CDS.

When users are adding in data to my main table and to the linked tables
everything is fine.  When they then try to add in a record to child
table the insert fails on the post event.  The key field is called
"PROPOSAL_NB" and it is defined as char (5) on the server.

Here is the scenario that is occurring.  For argument sake the value in
the "PROPOSAL_NB" field is 89.  Everything works fine when the initial
insert into the parent and child tables occur.  If the user goes back
in, to insert an additional row of data in the child table, the "Post"
of the data in the CDS is failing.  Here is why I think that it is
failing.  The length of the data in the "PROPOSAL_NB" field in the child
table is 2.  The length of the data in the "PROPOSAL_NB" field in the
parent table is 5.  I am thinking that because of the difference in the
data length the post is failing since the key fields do not match.  I
have tried to using the "StringOfChar" function and the "format"
function to stuff the string so that it is the proper length.  When the
data is placed in the child table it goes back to being a length of 2.

Does anyone have any suggestions on how this can be resolved?

Thanks


James D. Stewart 
Senior Systems Analyst

Carlson Wagonlit Travel | SatoTravel
4300 Wilson Blvd Suite 500
Arlington, VA 22203-4167

Email: [EMAIL PROTECTED]
Phone: 703-682-7226 (Direct)
Phone: 800-776-7286 ext. 27226



_______________________________________________
Delphi-DB mailing list
[email protected]
http://www.elists.org/mailman/listinfo/delphi-db

Reply via email to