We are using Microsoft Navision 4.0 SP3 with SQL 2005 . While posting few documents we are getting an below mentioned error (marked in bold which I feel it resembles to Sql 2005.
1088,“42000”[micrsoft ][ODBC][SQl Server] canot find object "Capa.dbo.CML$RGP ledger Entry because it does not exists or you do not have permissions."
SQL : Set Identify_insert “capa.dbo.CML$RGP Ledger Entry” ON
I tried my best to resolve this but unforunately gone unsuccesfull.
Can anyone please help me to resolve this problem.
Obviouly you are using “AutoIncrement” on this table “RGP Ledger Entry”, I guess its Primary Key is something like “Entry No.”. Have in mind that in “INIT” command does not reset PK fields, thus “AutoIncrement” PK must be initialized manually with Zero, e.g.
RPGLedgerEntry.INIT;
RPGLedgerEntry.“Entry No.” := 0;
…
RPGLedgerEntry.INSERT;
If you don’t do that, then C/SIDE will try to change the “IDENTITY_INSERT” flag (the corresponding SQL feature of “AutoIncrement”) on runtime, and to do this you need to be at least db_owner. If you are not, you get the error you described …
Hence, once you made sure the AI field is always initialized properly, the error should vahish.