Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with Flexgrid
Message
 
À
13/10/2000 18:32:58
Jorge Haro
Independent Consultant
Juarez, Mexique
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00429434
Message ID:
00429517
Vues:
15
>Hi, I'm having trouble binding a recordset to the Microsoft FlexGrid Control version 6.0, basically I can't :). I know it's supposed to be a straight forward process, and I've been reading through previous posts about it and it seems there hasn't been an answer for those who have had the same problem. This is the code:
>
>
>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
>
>
>
>
>As indicated in the code I get either type mismatch or unknown name.
>
>I'm using VFP 6 SP4 on a Windows 2000 machine
>
>TIA


< Cetin >
"Problems with Flexgrid"
Jorge,
This works when you bind to a MS datagrid control but not MSFlex or MSHFlex control as I could find. However with MSFlex and MSHflex grid controls I could bind the datasource if I put a MS Data Control on form. Below is the code of DataControl.Init :


#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 >

PS. Due to a problem Cetin could not send this message himself. That's whys he asked us to do so.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform