Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor Adapter Woes
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00804552
Message ID:
00804872
Views:
24
Well, it turned out to be a bonehead developer issue at this end after all, although, MS might consider saving us from ourselves by removing all chr(13)/chr(10)'s from the .SelectCmd (and perhaps other properties like .UpdatableFieldList, .UpdateNameList, .KeyFieldList etc) or throwing a meaningful error.


Here's the repro (the problem is caused by the chr(13) in the SelectCmd):
close tables
loCursor = CREATEOBJECT("CursorAdapter")
WITH loCursor
  .Alias          = 'CustomersCursor'
  .DataSourceType = 'Native'
  .DataSource     = _samples+"northwind\northwind.dbc"
  .SelectCmd      = "select CUSTOMERID , COMPANYNAME, CONTACTNAME from CUSTOMERS where .t."+chr(13)
  .KeyFieldList   = 'CUSTOMERID'
  .Tables         = 'CUSTOMERS'

  *-- will open a "query" browse on the next line
  .cursorFill() 
  *-- after completion, the "query" cursor is renamed "Customercursor" as expected
  .cursorDetach()
endwith
set
*-- if the cursor is left open, the error will not occur the second time this test is run
use in [CustomersCursor] 
-lc
Previous
Reply
Map
View

Click here to load this message in the networking platform