Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extracting query text via ADO in VFP
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Extracting query text via ADO in VFP
Miscellaneous
Thread ID:
01151362
Message ID:
01151362
Views:
90
Hi guys,

I'm trying to pull data from an Access MDB. I can create an object such as
oA2k3 = GetObject(, "Access.Application")
and retrieve table names . . . which I can then extract data via ODBC.
.
.
OPEN DATABASE 'testdata'
STORE SQLCONNECT('db0') TO nConnHandle

FOR n = 0 TO oA2k3.CurrentData.AllTables.Count - 1  && array begins at 0?
  WITH oA2k3.CurrentData.AllTables.Item(n)
    cSQL = 'SELECT TOP 1 * FROM ' + CHR(34) + .Name + CHR(34)
    nRetVal = SQLEXEC(nConnHandle, cSQL, 'results')
  ENDWITH 
ENDFOR 
That works so far.

However, what I want to do is extract the text of the many, many querries. I see an object called "AllQueries" but it doesn't seem to be active.

Is there a way to retrieve the SQL text string (not the results) from the querries?
Next
Reply
Map
View

Click here to load this message in the networking platform