Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter Class
Message
 
À
25/11/2002 18:12:02
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00726719
Message ID:
00726736
Vues:
22
Hilmar,

I read the article and pull out this exmple. I modified for
a DBC I have, and when I run it, nothing happens:
oCustomersData = CreateObject("CustomersData")

Define CLASS CustomersData as CursorAdapter

Procedure Init

	*-- Our Source Type now is "ADO"
	This.DataSourceType = "ADO"

	*-- We´ll add a property to store an ADO Connection object.
	This.AddProperty('oConn', NewObject("ADODB.Connection"))

	*-- And another property to store an ADO RecordSet object.
	This.AddProperty('oRS', NewObject("ADODB.Recordset"))

	 *-- We´ll set the Connection String for the Connection object, as we´re quite used to.

	This.oConn.ConnectionString = ;
	"Provider=VFPOLEDB.1;Data Source=D:\Projects\Visual FoxPro\BM\Data\Bm.DBC"

	*-- ...and open the connection.
	This.oConn.Open()

	*-- Let´s set this newly created connection as the Active Connection
	*-- for our RecordSet object.
	This.oRS.ActiveConnection = This.oConn

	*-- ...and set the RecordSet as the data source for this Cursor Adapter.		
	This.DataSource = This.oRS

	*-- This is our command to bring our data.
	This.SelectCmd = "select * from clients"

	*-- And fill up our Cursor with data, big boy!
	This.CursorFill()

EndProc

EndDefine
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform