Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Possible BUG with CA and delete operations
Message
From
11/06/2004 05:46:24
Eyvind W. Axelsen
Profdoc Norge As
Oslo, Norway
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
Possible BUG with CA and delete operations
Miscellaneous
Thread ID:
00912598
Message ID:
00912598
Views:
51
In our project, we use cursoradapters to connect to a SQL Server via ADO. We recompiled the whole thing in vfp 9 beta, and most of it seems to work perfectly - great job by the fox team!

However, there are some problems when deleting from a CA based on joined tables. The sample code below runs perfectly fine in fox 8, but in 9b, TableUpdate returns .F., and the error message is "Microsoft Cursor Engine : Row handle referred to a deleted row or a row marked for deletion".

code:

Public loCAdapter As CursorAdapter

Local loCon As ADODB.Connection
loCon = Createobject("ADODB.Connection")
loCon.Open("")

loCAdapter = Createobject("catest")
loCAdapter.DataSourceType="ADO"
loCAdapter.Datasource = Createobject('ADODB.RecordSet')
loCAdapter.Datasource.CursorLocation = 3 && adUseClient
loCAdapter.Datasource.LockType = 3 && adLockOptimistic
loCAdapter.BufferModeOverride = 5
loCAdapter.Datasource.ActiveConnection = loCon
loCAdapter.BreakOnError= .T.
loCadapter.Alias = "caTest"

llReturn = loCAdapter.RetrieveData()
If !llReturn
MessageBox(Message())
EndIf

Select caTest
delete all
if !tableupdate(.T.)
Messagebox(message())
endif

Define Class caTest As cursoradapter

Procedure selectcmd_assign
Lparameters vNewVal
This.SelectCmd = Chrtran(m.vNewVal, Chr(13) + Chr(10), "")
EndProc

Procedure retrievedata()
Text To this.selectcmd Noshow textmerge
Select testchild.id, testchild.foreignkey, testchild.somedata,
testparent.descr
from testchild, testparent
where testparent.id = testchild.foreignkey
EndText

this.UpdatableFieldList = "id, foreignkey, somedata"
this.UpdateNameList = "id testchild.id, foreignkey testchild.foreignkey, somedata testchild.somedata"
this.Tables = "Testchild"
this.KeyFieldList = "id"

Return this.CursorFill()
EndProc

Procedure aftercursorfill
Lparameters lUseCursorSchema, lnoDataOnLoad, cSelectCmd, lResult
This.DataSource.Properties("Unique Table") = this.Tables
EndProc

Enddefine



Any help would be greatly appreciated.

Thanks,

Eyvind.
Next
Reply
Map
View

Click here to load this message in the networking platform