Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invalid object name TableName
Message
De
12/01/2021 12:44:51
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01677801
Message ID:
01677813
Vues:
40
Then the UPDATRE SQL fails
Trace the BeforeUpdate Event, it owns an tcUpdateInsertCmd parameter. Check it's value. This is the command VFP will run to update the table.

Try to get all the code of the CA using classbrowser.
Try to adress dbc tables in the DBC!Table syntax
An example to declare with DBC: (this from may frame, just to show the values)
LOCAL;
 lcTemp AS CHARACTER,;
 lcDBC1 AS CHARACTER

*Verwendete Datenbanken
lcDBC1 = JUSTSTEM(DBC())		&&Database No 1; Original: _000

*zusätzliche Eigenschaften für diesen Adapter zufügen,
*welche zur Kommunikation mit der Form gebraucht werden
*!*	ADDPROPERTY(THIS.empSettings,'SomeProp',0)

*Type des Adapters. Wird zum Löschen und Neuanlegen genutzt.
*AllowDelete und AllowInsert auf entsprechende Werte setzten
THIS.gnBase_Type = dnTyp_Auftrag
THIS.ALLOWDELETE = .F.
THIS.ALLOWINSERT = .F.

IF !USED('Auftrag') THEN
 USE Auftrag IN 0
ENDIF &&!USED('Auftrag')

***<SelectCmd>
TEXT TO lcTemp NOSHOW TEXTMERGE PRETEXT 7
 SELECT
  Cur1.iObJ_Ix,
  Cur1.Proje_T_Ix,
  Cur1.Parent_Ix,
  Cur1.iTyp,
  Cur1.iSubTyp,
  Cur1.cName,
  L1V1 AS L1V1_1,
  L1V2 AS L1V2_1,
  L1V3 AS L1V3_1,
  C1F2 AS C1F2_1,
  C1F3 AS C1F3_1,
  C2F1 AS C2F1_1,
  C2F2 AS C2F2_1,
  C3F1 AS C3F1_1,
  C3F2 AS C3F2_1,
  C3F3 AS C3F3_1,
  C3F4 AS C3F4_1,
  C4F1 AS C4F1_1,
  C4F2 AS C4F2_1,
  C4F7 AS C4F7_1,
  C4F8 AS C4F8_1,
  C5F1 AS C5F1_1,
  C5F2 AS C5F2_1,
  C9F1 AS C9F1_1,
  i1F1 AS i1F1_1,
  ICASE(i1F1=dnDeu,2,i1F1=dnUK,3,1) AS iLang,
  N1F1 AS N1F1_1,
  L1F1 AS L1F1_1,
  L1F2 AS L1F2_1,
  D1F1 AS D1F1_1,
  D1F2 AS D1F2_1,
  M1F1 AS M1F1_1,
  M1F2 AS M1F2_1,
  Cur1.tLastRev
  FROM  <<lcDBC1>>!Auftrag AS Cur1
  WHERE Cur1.iTyp=dnTyp_Auftrag
   AND Cur1.iSubTyp=1
ENDTEXT
lcTemp = STRTRAN(lcTemp,CRLF," ")
lcTemp = STRTRAN(lcTemp,dcTab,"")
THIS.SELECTCMD = lcTemp
***</SelectCmd>

***<CursorSchema>
TEXT TO lcTemp NOSHOW PRETEXT 7
 IOBJ_IX    I,
 PROJE_T_IX I,
 PARENT_IX  I,
 ITYP       I,
 ISUBTYP    I,
 CNAME      C(40),
 L1V1_1     L,
 L1V2_1     L,
 L1V3_1     L,
 C1F2_1     C( 1),
 C1F3_1     C( 1),
 C2F1_1     C( 5),
 C2F2_1     C( 5),
 C3F1_1     C(10),
 C3F2_1     C(10),
 C3F3_1     C(10),
 C3F4_1     C(10),
 C4F1_1     C(20),
 C4F2_1     C(20),
 C4F7_1     C(20),
 C4F8_1     C(20),
 C5F1_1     C(30),
 C5F2_1     C(30),
 C9F1_1     C(38),
 i1F1_1     i,
 iLang		i,
 N1F1_1     n(12,3),
 L1F1_1     L,
 L1F2_1     L,
 D1F1_1     D,
 D1F2_1     D,
 M1F1_1     M,
 M1F2_1     M,
 TLASTREV   T
ENDTEXT
lcTemp = STRTRAN(lcTemp,CRLF, "")
THIS.CURSORSCHEMA = lcTemp
***</CursorSchema>

***<Tables>
TEXT TO lcTemp NOSHOW TEXTMERGE PRETEXT 7
 <<lcDBC1>>!Auftrag
ENDTEXT
lcTemp = STRTRAN(lcTemp,CRLF, "")
THIS.TABLES = lcTemp
***</Tables>

***<KeyFieldList>
TEXT TO lcTemp NOSHOW PRETEXT 7
 PROJE_T_IX
ENDTEXT
lcTemp = STRTRAN(lcTemp,CRLF, "")
THIS.KEYFIELDLIST = lcTemp
***</KeyFieldList>

***<UpdatableFieldList>
TEXT TO lcTemp NOSHOW PRETEXT 7
 IOBJ_IX,
 PROJE_T_IX,
 PARENT_IX,
 ITYP,
 ISUBTYP,
 CNAME,
 L1V1_1,
 L1V2_1,
 L1V3_1,
 C1F2_1,
 C1F3_1,
 C2F1_1,
 C2F2_1,
 C3F1_1,
 C3F2_1,
 C3F3_1,
 C3F4_1,
 C4F1_1,
 C4F2_1,
 C4F7_1,
 C4F8_1,
 C5F1_1,
 C5F2_1,
 C9F1_1,
 i1F1_1,
 N1F1_1,
 L1F1_1,
 L1F2_1,
 D1F1_1,
 D1F2_1,
 M1F1_1,
 M1F2_1,
 TLASTREV
ENDTEXT
lcTemp = STRTRAN(lcTemp,CRLF, "")
THIS.UPDATABLEFIELDLIST = lcTemp
***</UpdatableFieldList>

***<UpdateNameList>
TEXT TO lcTemp NOSHOW TEXTMERGE PRETEXT 7
 IOBJ_IX    <<lcDBC1>>!Auftrag.iObj_Ix,
 PROJE_T_IX <<lcDBC1>>!Auftrag.Proje_T_Ix,
 PARENT_IX  <<lcDBC1>>!Auftrag.Parent_Ix,
 ITYP       <<lcDBC1>>!Auftrag.iTyp,
 ISUBTYP    <<lcDBC1>>!Auftrag.iSubTyp,
 CNAME      <<lcDBC1>>!Auftrag.cName,
 L1V1_1     <<lcDBC1>>!Auftrag.L1V1,
 L1V2_1     <<lcDBC1>>!Auftrag.L1V2,
 L1V3_1     <<lcDBC1>>!Auftrag.L1V3,
 C1F2_1     <<lcDBC1>>!Auftrag.C1F2,
 C1F3_1     <<lcDBC1>>!Auftrag.C1F3,
 C2F1_1     <<lcDBC1>>!Auftrag.C2F1,
 C2F2_1     <<lcDBC1>>!Auftrag.C2F2,
 C3F1_1     <<lcDBC1>>!Auftrag.C3F1,
 C3F2_1     <<lcDBC1>>!Auftrag.C3F2,
 C3F3_1     <<lcDBC1>>!Auftrag.C3F3,
 C3F4_1     <<lcDBC1>>!Auftrag.C3F4,
 C4F1_1     <<lcDBC1>>!Auftrag.C4F1,
 C4F2_1     <<lcDBC1>>!Auftrag.C4F2,
 C4F7_1     <<lcDBC1>>!Auftrag.C4F7,
 C4F8_1     <<lcDBC1>>!Auftrag.C4F8,
 C5F1_1     <<lcDBC1>>!Auftrag.C5F1,
 C5F2_1     <<lcDBC1>>!Auftrag.C5F2,
 C9F1_1     <<lcDBC1>>!Auftrag.C9F1,
 i1F1_1     <<lcDBC1>>!Auftrag.i1F1,
 N1F1_1     <<lcDBC1>>!Auftrag.N1F1,
 L1F1_1     <<lcDBC1>>!Auftrag.L1F1,
 L1F2_1     <<lcDBC1>>!Auftrag.L1F2,
 D1F1_1     <<lcDBC1>>!Auftrag.D1F1,
 D1F2_1     <<lcDBC1>>!Auftrag.D1F2,
 M1F1_1     <<lcDBC1>>!Auftrag.M1F1,
 M1F2_1     <<lcDBC1>>!Auftrag.M1F2,
 TLASTREV   <<lcDBC1>>!Auftrag.tLastRev
ENDTEXT
lcTemp = STRTRAN(lcTemp,CRLF, "")
THIS.UPDATENAMELIST = lcTemp
***</UpdateNameList>
>The point is that when I delete a record, I don't really delete a record. It simply sets a value in field REC_ID to 'D' and then saves the records.
>And during this SAVE I get the error message pointing to a non-existing table. I did GoFish4 for this table name and nothing found.
>It must be in one of the free DBF tables, used for meta configurations. So far, nothing comes up.
>Thank you.
>>Sounds like the SQL commands used to delete the record are wrong
>>
>>Check the Tables, UpdatableFieldList and KeyFieldList properties of the CA against the tables used in the CA.
>>Check the more obscure Delete* Properties
>>Check the BeforeDelete and AfterDelete events
>>
>>Use the Before* Events to check what SQL string is send to the server,
>>
>>
>>>Hi,
>>>
>>>I am troubleshooting a problem. I am trying to delete a record from a table in the SQL Server. I am using cursor adapter.
>>>On the =tableupdate() command of the CA view, I get error:
>>>
>>>Invalid object name 'TableName2'
>>>
>>>
>>>TableName2 used to be in the database. But I removed it some time ago. Where could the connection between the table TableName1 and TableName2?
>>>
>>>TIA
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform