40 pts.
 Read Only Table
I create a table in sql server 2k5, the script is look like this: CREATE TABLE [dbo].[tb1PmtD]( [PmtDLU] [int] NOT NULL, [PmtDInvLU] [int] NOT NULL, [PmtDAmount] [money] NOT NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[tb1PmtD] WITH NOCHECK ADD CONSTRAINT [tb1Pmttb1PmtD] FOREIGN KEY([PmtDLU]) REFERENCES [dbo].[tb1Pmt] ([PmtID]) ON UPDATE CASCADE GO ALTER TABLE [dbo].[tb1PmtD] CHECK CONSTRAINT [tb1Pmttb1PmtD] When i open this table in ms access data project, recordset in this table is marked as read-only...can't add records or delete. Please help me, what's wrong with my code.

Software/Hardware used:
ASKED: September 9, 2008  9:08 PM
UPDATED: September 10, 2008  4:38 PM

Answer Wiki:
If I remember my Microsoft Access correctly you have to have a primary key on the table in the SQL Server database for Microsoft Access to be able to write to the table. Assuming your first column in the primary key the CREATE TABLE command would look something like this. <pre> CREATE TABLE [dbo].[tb1PmtD]( [PmtDLU] [int] PRIMARY KEY NOT NULL, [PmtDInvLU] [int] NOT NULL, [PmtDAmount] [money] NOT NULL ) ON [PRIMARY] GO</pre> You will need to remove the link from the Access database to the SQL Table and recreate it after your recreate the table.
Last Wiki Answer Submitted:  September 10, 2008  3:12 am  by  Denny Cherry   64,550 pts.
All Answer Wiki Contributors:  Denny Cherry   64,550 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.

 64,550 pts.

 

Thanks, i got the point. Table in sql server must have an index and unique. I need to restructuring my table now.

 40 pts.