Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
CursorAdapter Question
Divers
Thread ID:
01008137
Message ID:
01008137
Vues:
59
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform