Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFPCOM used by VFP MTDLL? (revisited)
Message
From
04/10/2005 15:58:04
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01055800
Message ID:
01056045
Views:
16
>>>Can VFPCOM be used by a VFP MTDLL? This so that the DLL can easily return VFP cursors that have been converted into ADO recordsets (which in turn are passed back to an Active Server Page application)? For example, one question I have regards the thread-safety of VFPCOM. I would expect no problems using it with a single-threaded VFP EXE. But what happens with an MTDLL (that is invoked by a multithreaded application such as ASP)? Will VFPCOM still work in that environment?
>>
>>Mark,
>>If it's for converting VFP cursors to ADO recordsets why don't you directly use ADO itself? If you use ADO you'd be able to create much more sophisicated recordsets (ie: one with multiple tables hierarchically related). That's what I do at least.
>>Cetin
>
>I want to do queries and dredging (some not with SQL but instead with Scan/Endscan, etc) and generate a VFP cursor from all of that and pass the cursor back to ASP as an ADO recordset.

It doesn't matter. You could ADO select from result cursor. ie:
Local loADO As ADODB.RecordSet
Select * From (_samples+'Data\customer') Where Country='USA' Into Cursor crsTemp
loADO = ToADO('crsTemp')

Function ToADO
  Lparameters tcCursorName
  tcCursorName = Iif(Empty(m.tcCursorName),Alias(),m.tcCursorName)
  Local loConn As ADODB.Connection, ;
    loRS As ADODB.RecordSet,;
    lcTempRs, lcTemp

  lcTemp = Forcepath(Sys(2015)+'.dbf',Sys(2023))
  lcTempRs = Forcepath(Sys(2015)+'.rst',Sys(2023))
  Select (m.tcCursorName)
  Copy To (m.lcTemp)
  loConn = Createobject("Adodb.connection")
  loConn.ConnectionString = "Provider=VFPOLEDB;Data Source="+Addbs(Sys(2023))
  loConn.Open()
  loRS = loConn.Execute("select * from "+Juststem(m.lcTemp))
  loRS.Save(m.lcTempRs)
  loRS.Close
  loConn.Close
  Erase (m.lcTemp)
  loRS.Open(m.lcTempRs)
  Erase (m.lcTempRs)
  Return loRS
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
Previous
Reply
Map
View

Click here to load this message in the networking platform