Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bind CursorAdapter to a grid problem
Message
De
19/11/2004 23:58:22
Thomas Wang
Cts Int'l Transportation Co., Ltd.
Shanghai, Chine
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Bind CursorAdapter to a grid problem
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00963152
Message ID:
00963152
Vues:
46
I have a form with:
bindcontrols = .f.
buffermode = 2
datasession = 2

and also with a 3 columns grid and a button on the form.
In button click method:

local loCursor as CursorAdapter
loCursor = newobject("Cursoradapter")
lcConnString = 'driver=SQL Server;server=(local);database=Northwind;trusted_connection=yes'

with loCursor
.Alias = 'Customers'
.DataSourceType = 'ODBC'
.DataSource = sqlstringconnect(lcConnString,.t.)
text to .SelectCmd noshow
select CustomerID, CompanyName, ContactName from Customers
endtext
.KeyFieldList = 'CustomerID'
.Tables = 'Customers'
.UpdatableFieldList = 'CustomerID, CompanyName, ContactName'
.UpdateNameList = 'CUSTOMERID CUSTOMERS.CUSTOMERID,COMPANYNAME CUSTOMERS.COMPANYNAME, CONTACTNAME CUSTOMERS.CONTACTNAME'
.CursorFill()
endwith

thisform.BindControls = .t.
thisform.grdCustomers.RecordSource = "Customers"
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
when I click button, the grid just shows a blank area not show the result correctly.

What can i do about it ?

Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform