Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recordset to Cursor
Message
De
22/02/2006 17:17:55
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01098156
Message ID:
01098291
Vues:
22
I see, if you have the structure beforehand then I have a brilliant (OK not so brilliant) idea:)
-Connect to existing local VFP table via VFPOLEDB
-Allowaddnew
-Loop RS and add to VFP's oRS
-UpdateBatch
(speed?-just and idea for now)

And if SQL server was in play it might be much easier using OpenRowSet() with the above idea.

There was a document somewhere how to convert ADO RS to ADO.Net dataset. Wish .Net was in play.
PS: Not to discourage you but even if you pass this there are different RS supported types that cannot be converted to cursor(s) w/o too much work.
Cetin

>Yes, precisely. The problem is that at the line...
>
>oXMLAdapter.LoadXML(xdom.xml)
>
>...there isn't any xml to load because the earlier call to...
>
>oRS.Save(xdom,1)
>
>...failed to create it because of the unsafe characters (forward slashes in my case).
>
>>I mean something like this:
>>
>>xdom = CREATEOBJECT("MSXML.Domdocument")
>>oCon = CREATEOBJECT("adodb.connection")
>>oCon.ConnectionString = "Provider=SQLOLEDB;server=(local);trusted_connection=yes"
>>oCon.open
>>oRS = oCon.execute("select * from northwind.dbo.customers")
>>oRS.Save(xdom,1)
>>oRS.Close
>>oCon.Close
>>
>>LOCAL oXMLAdapter as XMLAdapter
>>oXMLAdapter = NEWOBJECT('XMLAdapter')
>>oXMLAdapter.LoadXML(xdom.xml)
>>oXMLAdapter.Tables.Item(1).ToCursor(,'myCustomers')
>>browse
>>
Cetin
>>
>>>Have tried this with every version of MS XML and XMLAdapter won't make a difference in this case because the problem is that the xml member of the DOMDocument never gets populated by the Recordset's save method.
>>>
>>>>Yet another idea:) XMLAdapter might work with xdom.xml better?
>>>>Cetin
>>>>
>>>>>>Craig,
>>>>>>Since you have data to test with, try with another flag excluding 1024 (say 0 or 4 only). Also you can try an alternative:
>>>>>>
>>>>>>oRS.Save("mytemp.xml",1)
>>>>>>xmltocursor("myTemp.xml",'myCursor',512)
>>>>>>
>>>>>
>>>>>No difference, already had tried the 4 and 0, and as for creating the file on disk it is noticeably slower and same problem. I sure wish that Microsoft had put a method on the recordset or the DOMDocument that would allow for escaping these XML unsafe characters. I'm a little surprised that it's not there to be honest. Since the XML never gets created on the Save method of the recordset there's no way I can see to fix this besides a rather clumsy hack... I hate hacks, but they're better than no solution at all. Perhaps you're right, that a better solution is still out there. I'll keep my fingers crossed and the stars for you in case nothing comes through by later tonight. Thanks again Cetin... if you get any other ideas I'm all ears.
>>>>>
>>>>>>PS: I never mind about stars:) Keep as is so a better solution might come.
>>>>>>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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform