Allen wrote on 2010-06-08:
> I thought ADO had its own scan or go next or something like that. Al
>
> -----Original Message-----
> From: Grigore Dolghin
> Sent: 08 June 2010 14:39
>
> I would _strongly_ suggest to use ODBC, not ADO. One of the reasons is
> ADO returns recordsets, which you cannot SCAN...ENDSCAN, for example.
>
>
Allen,
It does, however, depending on what OleDB you are using, the indexing
available may not increase the speed of searches. It is possible to bring
the ADO RecordSet to a Cursor using the CursorAdapter.
Rafael,
Each extra piece you work with is a little extra time. I use the code below
for read only purposes. There are plenty of ways to create views using an
ODBC connection, and the CursorAdapter can be useful for writing data back
through ADO. I have not personally worked with writing data to other data
sources in a long time.
Tracy Pearson
PowerChurch Software
loRSt = CREATEOBJECT("ADODB.RecordSet")
loRSt.ActiveConnection = << Your connection string goes here >>
loCAx = CREATEOBJECT('myCA')
loCAx.Alias = STRTRAN(cName, " ", "_")
loCAx.Tables = loTab.Name
loCAx.DataSource = loRSt
loCAx.DataSourceType="ADO"
loCAx.SelectCmd = 'Select * from "' + cName + '"'
loCAx.CursorFill(.F.)
*-- Leave cursor open
loCAx.CursorDetach()
RELEASE loCAx
IF loRSt.State<> 0
loRSt.Close()
ENDIF
DEFINE CLASS myCA as CursorAdapter
FetchSize=-1
FetchMemo=.T.
CompareMemo=.F.
UseMemoSize=255
FetchAsNeeded=.F.
Prepared = .F.
ENDDEFINE
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/000301cb070c$1e629410$5b27bc...@com
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.