General information
Title:
Dynamic cursoradapter & grid
Environment versions
Network:
Windows 2000 Server
Hello all!
I'm quite new to VFP so pls bear with me.
I'm trying various ways to connect to a SQL Server 2000.
I've found this nice code (which works) :
local loCursor as CursorAdapter, ;
laErrors[1]
set multilocks on
loCursor = createobject('CursorAdapter')
with loCursor
.Alias = 'Customers'
.DataSourceType = 'ODBC'
*** Use appropriate connection settings here
.DataSource = sqlstringconnect('driver=SQL Server;' + ;
'server=(local);database=Northwind;uid=sa;pwd=;' + ;
'trusted_connection=no')
.SelectCmd = "select CUSTOMERID, COMPANYNAME, CONTACTNAME " + ;
"from CUSTOMERS where COUNTRY = 'Brazil'"
.KeyFieldList = 'CUSTOMERID'
.Tables = 'CUSTOMERS'
.UpdatableFieldList = 'CUSTOMERID, COMPANYNAME, CONTACTNAME'
.UpdateNameList = 'CUSTOMERID CUSTOMERS.CUSTOMERID, ' + ;
'COMPANYNAME CUSTOMERS.COMPANYNAME, CONTACTNAME CUSTOMERS.CONTACTNAME'
if .CursorFill()
BROWSE
else
aerror(laErrors)
messagebox(laErrors[2])
endif .CursorFill()
ENDWITH
Now instead of Browse, I would like to use a grid.
My question is what should I pass to
thisform.grdDynamic.RecordSource and thisform.grdDynamic.RecordSourceType?
Thank you very much
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only