Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use ADO SHAPE programmatically ?
Message
De
04/11/1999 09:33:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/11/1999 09:23:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00281566
Message ID:
00286825
Vues:
21
>>>Cetin:
>>>
>>>Here is what you do:
>>>
>>>(1) create DSN in ODBC setup to VFP Database
>>>(2) create an msdatashape provider by right clicking desktop, file new MS Data Link, under connection tab add DSN to 'Data Source'. Test Connection.
>>>
>>>oConn=createobject('adodb.connection')
>>>oRs =createobject('adodb.recordset')
>>>oConn.provider = 'msdatashape'
>>>oConn.open('igcms')
>>>shape = "shape {select * from cases order by caseno} " + ;
>>>"append ({select * from people} relate pk_cases to fk_cases) as people"
>>>oRs.open(shape, oConn)
>>>
>>>The cases table is related to the people table on pk_cases = fk_cases
>>>
>>>* get case fields
>>>?oRs.fields('some_field_from_cases_table').value
>>>
>>>* get matching people fields
>>>x=oRs.fields('people').value
>>>?x.fields('some_field_from_people_table').value
>>>
>>>I just tried it for the first time and it worked.
>>>
>>>Charlie
>>
>>
>Hi Charlie,
>>Very much thanks for replying. I was trying to do it w/o a need to create a .UDL or something else at control panel and suceeded at last :)
>>What I was doing wrong was the parentheses in shape command. Oh my God, using 1280*1024 resolution I always got it as () but it was {} like in date datatype.
>>Error message is "Data shape command has syntax error at or near ...".
>>Cetin
>
>Hi Cetin
>You may already be aware of this, but just in case...
>Note that the shape provider pulls over all records from the child select, unless you use a parameter. In other words, if you have a main select as "select * from customers where ID_Customer = ..." with an append "select * from orders", all orders for all customers will be pulled over the wire.
>This is "by design", ref. KB article Q196968 - PRB: SHAPE Provider Pulls Down All Records in Child Table
>

>
>Arne


Arne,
Thanks for info. I expected that but honestly wasn't aware yet. Will keep in mind.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform