Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot add to or edit one table

Status
Not open for further replies.

petermeachem

Programmer
Aug 26, 2000
2,270
GB
My customer's computer guy is driving me potty ringing up with this problem.

The data in one sql server 7 service pack 1 (i think). They are using Access 97 logged to an nt server.

1) One table is acting as though is does not have a primary key. Access cannot add a record, or edit any records. The error message is to the effect that someone else is editing the record (which they aren't).

2) They are also having trouble logging in. The table was attached via a dsn with trusted connection set. When they start access, it asks for a login.

needless to say, this all works fine here. Any help appreciated.

Script follows:-

/****** Object: Table [dbo].[Order_Entry_Table] Script Date: 1/17/01 9:53:46 AM ******/
if exists (select * from sysobjects where id = object_id(N'[dbo].[Order_Entry_Table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Order_Entry_Table]
GO


/****** Object: Table [dbo].[Order_Entry_Table] Script Date: 1/17/01 9:54:10 AM ******/
CREATE TABLE [dbo].[Order_Entry_Table] (
[OrderEntryId] [int] IDENTITY (1, 1) NOT NULL ,
[Supplier] [varchar] (20) NULL ,
[TestSupplier] [varchar] (50) NULL ,
[SupplierName] [varchar] (50) NULL ,
[User_Initials] [varchar] (50) NULL ,
[InputDate] [datetime] NULL ,
[Transmit] [datetime] NULL ,
[ID] [varchar] (20) NULL ,
[DELCOL] [varchar] (50) NULL ,
[WEIGHT] [real] NULL ,
[VOLUME] [real] NULL ,
[DEPOT] [varchar] (50) NULL ,
[EDTIME] [datetime] NULL ,
[EDDAY] [varchar] (10) NULL ,
[LDTIME] [datetime] NULL ,
[LDDAY] [varchar] (10) NULL ,
[TOTULT] [varchar] (50) NULL ,
[FIXULT] [varchar] (50) NULL ,
[Invoice] [int] NULL ,
[InvoiceDate] [datetime] NULL ,
[SageExportStatus] [int] NULL ,
[NAME] [varchar] (25) NULL ,
[LOCATION] [varchar] (25) NULL ,
[DepotDepartTime] [datetime] NULL ,
[RouteNumber] [int] NULL ,
[TripNumber] [int] NULL ,
[ArrivalTime] [datetime] NULL ,
[DepartureTime] [datetime] NULL ,
[ActualPallets] [real] NULL ,
[DepotArriveTime] [datetime] NULL ,
[Price] [money] NULL ,
[InvoicePrinted] [bit] NULL ,
[WindowLink] [varchar] (50) NULL ,
[PickupPoint] [varchar] (50) NULL ,
[DeliveryNote] [varchar] (255) NULL ,
[CollectionPoint] [varchar] (50) NULL ,
[Confirmed] [bit] NULL ,
[ConfirmedLabel] [varchar] (20) NULL ,
[NewRecordAt] [datetime] NULL ,
[RecordChangedBy] [varchar] (50) NULL ,
[RecordChangedAt] [datetime] NULL ,
[DeliveryDepot] [varchar] (20) NULL ,
[InvoicingDepot] [varchar] (20) NULL ,
[OrderExported] [bit] NULL ,
[ExportedDate] [datetime] NULL ,
[TimeOnbay] [datetime] NULL ,
[TimeOffBay] [datetime] NULL ,
[POD] [varchar] (50) NULL ,
[Returnedpallets] [int] NULL ,
[Detail3] [varchar] (50) NULL ,
[NominalCode] [varchar] (50) NULL ,
[ForeignId] [int] NULL ,
[Chargeable] [bit] NULL ,
[PalletsCollected1] [int] NULL ,
[PalletsCollected2] [int] NULL ,
[PalletsCollected3] [int] NULL ,
[PalletsCollected4] [int] NULL ,
[PalletsCollected5] [int] NULL ,
[PalletsCollected6] [int] NULL ,
[Trailer1] [varchar] (10) NULL ,
[Trailer2] [varchar] (10) NULL ,
[Trailer3] [varchar] (10) NULL ,
[Trailer4] [varchar] (10) NULL ,
[Trailer5] [varchar] (10) NULL ,
[Trailer6] [varchar] (10) NULL ,
[CustomerSupplierOrderNo] [varchar] (50) NULL ,
[chkChanged] [bit] NULL ,
[SumCollected] [int] NULL ,
[LaneNo] [varchar] (10) NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Order_Entry] WITH NOCHECK ADD
CONSTRAINT [aaaaaOrder_Entry_PK] PRIMARY KEY NONCLUSTERED
(
[ID1]
) ON [PRIMARY]
GO

CREATE INDEX [ID] ON [dbo].[Order_Entry]([ID]) ON [PRIMARY]
GO

CREATE INDEX [NAME] ON [dbo].[Order_Entry]([NAME]) ON [PRIMARY]
GO
Peter Meachem
peter@accuflight.com
 
Sorry, the script was the wrong one:-

/****** Object: Table [dbo].[Order_Entry_Table] Script Date: 4/25/01 1:06:38 PM ******/
if exists (select * from sysobjects where id = object_id(N'[dbo].[Order_Entry_Table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Order_Entry_Table]
GO

/****** Object: Table [dbo].[Order_Entry_Table] Script Date: 4/25/01 1:06:41 PM ******/
CREATE TABLE [dbo].[Order_Entry_Table] (
[OrderEntryId] [int] IDENTITY (1, 1) NOT NULL ,
[Supplier] [varchar] (20) NULL ,
[TestSupplier] [varchar] (50) NULL ,
[SupplierName] [varchar] (50) NULL ,
[User_Initials] [varchar] (50) NULL ,
[InputDate] [datetime] NULL ,
[Transmit] [datetime] NULL ,
[ID] [varchar] (20) NULL ,
[DELCOL] [varchar] (50) NULL ,
[WEIGHT] [real] NULL ,
[VOLUME] [real] NULL ,
[DEPOT] [varchar] (50) NULL ,
[EDTIME] [datetime] NULL ,
[EDDAY] [varchar] (10) NULL ,
[LDTIME] [datetime] NULL ,
[LDDAY] [varchar] (10) NULL ,
[TOTULT] [varchar] (50) NULL ,
[FIXULT] [varchar] (50) NULL ,
[Invoice] [int] NULL ,
[InvoiceDate] [datetime] NULL ,
[SageExportStatus] [int] NULL ,
[NAME] [varchar] (25) NULL ,
[LOCATION] [varchar] (25) NULL ,
[DepotDepartTime] [datetime] NULL ,
[RouteNumber] [int] NULL ,
[TripNumber] [int] NULL ,
[ArrivalTime] [datetime] NULL ,
[DepartureTime] [datetime] NULL ,
[ActualPallets] [real] NULL ,
[DepotArriveTime] [datetime] NULL ,
[Price] [money] NULL ,
[InvoicePrinted] [bit] NULL ,
[WindowLink] [varchar] (50) NULL ,
[PickupPoint] [varchar] (50) NULL ,
[DeliveryNote] [varchar] (255) NULL ,
[CollectionPoint] [varchar] (50) NULL ,
[Confirmed] [bit] NULL ,
[ConfirmedLabel] [varchar] (20) NULL ,
[NewRecordAt] [datetime] NULL ,
[RecordChangedBy] [varchar] (50) NULL ,
[RecordChangedAt] [datetime] NULL ,
[DeliveryDepot] [varchar] (20) NULL ,
[InvoicingDepot] [varchar] (20) NULL ,
[OrderExported] [bit] NULL ,
[ExportedDate] [datetime] NULL ,
[TimeOnbay] [datetime] NULL ,
[TimeOffBay] [datetime] NULL ,
[POD] [varchar] (50) NULL ,
[Returnedpallets] [int] NULL ,
[Detail3] [varchar] (50) NULL ,
[NominalCode] [varchar] (50) NULL ,
[ForeignId] [int] NULL ,
[Chargeable] [bit] NULL ,
[PalletsCollected1] [int] NULL ,
[PalletsCollected2] [int] NULL ,
[PalletsCollected3] [int] NULL ,
[PalletsCollected4] [int] NULL ,
[PalletsCollected5] [int] NULL ,
[PalletsCollected6] [int] NULL ,
[Trailer1] [varchar] (10) NULL ,
[Trailer2] [varchar] (10) NULL ,
[Trailer3] [varchar] (10) NULL ,
[Trailer4] [varchar] (10) NULL ,
[Trailer5] [varchar] (10) NULL ,
[Trailer6] [varchar] (10) NULL ,
[CustomerSupplierOrderNo] [varchar] (50) NULL ,
[chkChanged] [bit] NULL ,
[SumCollected] [int] NULL ,
[LaneNo] [varchar] (10) NULL ,
[CustomerOrderID] [int] NULL ,
[InvoiceTo] [varchar] (20) NULL
) ON [PRIMARY]
GO



CREATE INDEX [NAME] ON [dbo].[Order_Entry_Table]([NAME]) ON [PRIMARY]
GO

CREATE INDEX [ROUTENUMBER] ON [dbo].[Order_Entry_Table]([RouteNumber]) ON [PRIMARY]
GO

CREATE INDEX [TRANSMIT] ON [dbo].[Order_Entry_Table]([Transmit]) ON [PRIMARY]
GO Peter Meachem
peter@accuflight.com
 
Peter,

Where is the unique index or primary key? I don't see it in the 2nd create query.

OrderEntryId looks like a good candidate for a primary key or unique index.

You can unlink and then relink the table in the Access database. If Access doesn't find a unique key it will ask for one. You can designate OrderEntryID even if it has not been created as such on SQL Server. However, I recommend creating the unique index on SQL. Terry
 
apologies, i missed it out of my post

ALTER TABLE [dbo].[Order_Entry_Table] WITH NOCHECK ADD
CONSTRAINT [aaaaaOrder_Entry_Table] PRIMARY KEY NONCLUSTERED
(
[OrderEntryId]
) ON [PRIMARY]
GO

The customer is going berserk. I've just had the managing director and financial director on the phone.

Peter Meachem
peter@accuflight.com
 
yep,

I've been reading half the MS web site and have sent them other scripts to try. Apparently bit fields, float and datetime fields can cause a problem like this if you don't have a timestamp.

They haven't replied as yet. These were the references I found.

This particularly amusing


This is why the linked table manager pegs out with sql file dsn's. I just thought it was a bug, but no.

Peter Meachem
peter@accuflight.com
 
Yes, I've asked them to try this. No reply yet. Peter Meachem
peter@accuflight.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top