M
matt.bennett
I have a simple infopath form that will be used to track a computer and
its host name with a person. I am trying to link it to an MS SQL
database. Right now I have a table called PERSON with a Person_ID and
a first and last name. The primary key is the Person_ID. The other
table i am using in the form is called MACHINE, with a foreign key
field p_id linked to the primary key of the PERSON table.
When I set up my data connection in infopath I first connect to the
MACHINE table, and then add the PERSON table. I set the relationship
between the 2 tables based on the p_id and person_id.
I set up a repeating table to view the fields in MACHINE as well as the
first and last name of the person it is assigned to. When i run the
query it works fine.
My problem starts at this point. once the query is ran, i can update
fields in the table and submit fine (When updating a field, i am not
touching the names of the person it is related to). However I can not
add a new record.
When i try to add a new record with an existing p_id, i get the
followign error
- [0x80040E2F][Microsoft OLE DB Provider for SQL Server]violation of
PRIMARY KEY constraint 'person_id_pk'. Cannot insert duplicate key in
object 'PERSON'.
-[0x80040E2F][Microsoft OLE DB Provider for SQL Server] The statement
has been terminated.
when i try to add a new record with a none existing p_id, i get the
following error
-[0x80040E2F][Microsoft OLE DB Provider for SQL Server] INSERT
statement conflicted with COLUMN FOREIGN KEY constraint
'FK_MACHINE_PERSON'. The conflict occurred in database 'master', table
'PERSON', column 'person_id'.
[0x80040E2F][Microsoft OLE DB Provider for SQL Server] The statement
has been terminated.
funny thing is when i try to add new record with a null (i don't
actually write null, but leave it blank)the MACHINE table and a record
of NULL data. However if i do this a second time, i get an error again
(since the NULL person exists).
i have tried changing the binding of the p_id text box to point to
person_id and this doesn't change a thing
can someone please help me before i pull my hair out?!?
thanks,
Matt
its host name with a person. I am trying to link it to an MS SQL
database. Right now I have a table called PERSON with a Person_ID and
a first and last name. The primary key is the Person_ID. The other
table i am using in the form is called MACHINE, with a foreign key
field p_id linked to the primary key of the PERSON table.
When I set up my data connection in infopath I first connect to the
MACHINE table, and then add the PERSON table. I set the relationship
between the 2 tables based on the p_id and person_id.
I set up a repeating table to view the fields in MACHINE as well as the
first and last name of the person it is assigned to. When i run the
query it works fine.
My problem starts at this point. once the query is ran, i can update
fields in the table and submit fine (When updating a field, i am not
touching the names of the person it is related to). However I can not
add a new record.
When i try to add a new record with an existing p_id, i get the
followign error
- [0x80040E2F][Microsoft OLE DB Provider for SQL Server]violation of
PRIMARY KEY constraint 'person_id_pk'. Cannot insert duplicate key in
object 'PERSON'.
-[0x80040E2F][Microsoft OLE DB Provider for SQL Server] The statement
has been terminated.
when i try to add a new record with a none existing p_id, i get the
following error
-[0x80040E2F][Microsoft OLE DB Provider for SQL Server] INSERT
statement conflicted with COLUMN FOREIGN KEY constraint
'FK_MACHINE_PERSON'. The conflict occurred in database 'master', table
'PERSON', column 'person_id'.
[0x80040E2F][Microsoft OLE DB Provider for SQL Server] The statement
has been terminated.
funny thing is when i try to add new record with a null (i don't
actually write null, but leave it blank)the MACHINE table and a record
of NULL data. However if i do this a second time, i get an error again
(since the NULL person exists).
i have tried changing the binding of the p_id text box to point to
person_id and this doesn't change a thing
can someone please help me before i pull my hair out?!?
thanks,
Matt