Problem while inserting into TMSQuery.
Posted: Tue 19 Jul 2005 11:32
Hi!
I have Delphi6+TMSQuery+MSSQL7.
CursorType=ctKeyset
FetchAll=True
UpdatingTable=DOCBODIES
SQL='SELECT B.PartID,B.LineTS,B.ID,B.OBJECTID, B.Val, B.Price, B.VAL,
B.Price as Amount, o.assortimentname as name
FROM DOCBODIES B
LEFT JOIN OBJECTS O ON B.ObjectID=O.ID WHERE B.ID=:ID
order by b.objectid'
I have one record in [docbodies] and try to add one.
I was call
MSQuery1.insert
...
MSQuery1.post
and inserted string was disappear from my grid!
it was appear agane after MSQuery1.RefreshRecords
profiler shows this text:
sp_cursor 550133852, 4, 0, N'DOCBODIES', 10642, '00001411', 11., 1.00
go
sp_cursorfetch 550133852, 16, 2, 1
go
sp_cursorfetch 550133852, 16, 1, 1
go
sp_cursorfetch 550133852, 16, 2, 1
go
sp_cursorfetch 550133852, 16, 1, 1
go
sp_cursorfetch 550133852, 16, 1, 1
client calls sp_cursorfetch 3 times (2 on both records and last time only the first)
Answer, please, why does it 3 times and why does the record disappear?
I have Delphi6+TMSQuery+MSSQL7.
CursorType=ctKeyset
FetchAll=True
UpdatingTable=DOCBODIES
SQL='SELECT B.PartID,B.LineTS,B.ID,B.OBJECTID, B.Val, B.Price, B.VAL,
B.Price as Amount, o.assortimentname as name
FROM DOCBODIES B
LEFT JOIN OBJECTS O ON B.ObjectID=O.ID WHERE B.ID=:ID
order by b.objectid'
I have one record in [docbodies] and try to add one.
I was call
MSQuery1.insert
...
MSQuery1.post
and inserted string was disappear from my grid!
it was appear agane after MSQuery1.RefreshRecords
profiler shows this text:
sp_cursor 550133852, 4, 0, N'DOCBODIES', 10642, '00001411', 11., 1.00
go
sp_cursorfetch 550133852, 16, 2, 1
go
sp_cursorfetch 550133852, 16, 1, 1
go
sp_cursorfetch 550133852, 16, 2, 1
go
sp_cursorfetch 550133852, 16, 1, 1
go
sp_cursorfetch 550133852, 16, 1, 1
client calls sp_cursorfetch 3 times (2 on both records and last time only the first)
Answer, please, why does it 3 times and why does the record disappear?