>public goConn, goRS > >goConn = Createobject("adodb.connection") >goRS = CreateObject("adodb.recordset") >goConn.ConnectionString = "data source = northwind;user id = sa" >goConn.Open > >goRS.ActiveConnection = goConn > >goRS.Open("employee") > >wait wind goRS.Fields(1).Value && Just for checking > >ThisForm.Flexgrid1.DataSource = goRS && Type Mismatch > >ThisForm.Flexgrid1.DataSource = goRS.Object && Unknown Name > > >>
#define TESTDATALOC C:\TEMP\testdata.DBC
strCn = [Provider=MSDataShape.1;Persist Security Info=False;]+;
[Data Source="Data Provider = MSDASQL;]+;
[DSN=Visual FoxPro Database;UID=;SourceDB=TESTDATALOC;]+;
[SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;]+;
[Deleted=Yes;";Data Provider=MSDASQL ]
strShp = [SHAPE { select customer.cust_id, Company, ]+;
[ orders.order_id, order_date, order_net, shipped_on, ]+;
[ line_no, prod_name ] +;
[ from customer ]+;
[ left outer join orders ]+ ;
[ on customer.cust_id = orders.cust_id ] +;
[ inner join orditems ]+ ;
[ on orditems.order_id = orders.order_id ] +;
[ inner join products ]+ ;
[ on orditems.product_id = products.product_id } ]
with this
.CommandType = 1
.ConnectionString = strCn
.RecordSource = strShp
endwith
with ThisForm.Flex
.Datasource = This.object
for ix = 1 to .Cols - 1
.MergeCol(ix) = .t.
endfor
.MergeCells = 3
endwith
thisform.DoSort(ThisForm.Flex)
< /Cetin >