Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapter Question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
CursorAdapter Question
Miscellaneous
Thread ID:
01008137
Message ID:
01008137
Views:
61
I have the test code below. It works fine. It returns the data
I want in the format I want.

Some questions:

1) When the object oCursor is destroyed, the table closes. Any way
to make it persist?

2) If the table can be persisted after the CA class is destroyed, can/how
are changes submitted back to the data source?

3) How would you impliment this? Obviously the structure required for each call
to this code might be different. It seems inifficient to have to create a PRG
for each table I want ot access.

4) How would you use the CA in a multi tier environment? If I create a class
based on session, with this code inside it, the resulting cursor is then in a
different session. We don't use DBC's. All tables are free tables.

Thanks!
CLOSE DATABASES ALL

LOCAL oCursor as CursorAdapter
LOCAL aErrors[1]

USE d:\projects\testdata\smts\station

oCursor = createobject("CursorAdapter")

WITH oCursor

.Alias = "MyStations"
.CursorSchema = "STName C(04), Afil C(20), Mkt C(20), Buyer C(2)"
.DataSourceType = "Native"
.SelectCmd = "SELECT StatName, Afiliate, Market, BInit FROM Station WHERE StatName = 'KTLA'"
.KeyFieldList = "STName"
.Tables = "Station"
.UpdatableFieldList = "STName, Afil, Mkt, Buyer"
.UpdateNameList = "STName Station.StatName, Afil Station.Afiliate, Mkt Station.Market, 
                  Buyer Station.BInit"

IF .CursorFill(.T.)
  BROWSE
  TABLEUPDATE(1)
ELSE
  AERROR(aErrors)
  MESSAGEBOX(aErrors[2],48,"Error Occured")
ENDIF

ENDWITH
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform