Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indexing a table from OleDb
Message
From
17/04/2007 22:20:34
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01153964
Message ID:
01217149
Views:
7
>Can you please tell exactly how did you make it work? Here http://www.tek-tips.com/viewthread.cfm?qid=1356865&page=1 the problem still seems to be unresolved.
>
>In the meantime I'm looking for a list of supported/unsupported VFP OldeDB commands. Forgot where did I see it.

This is an overview:
            loDataProviderIndex.CommandTextAdd("EXECSCRIPT(""USE " + Trim(loRowTable("Table")) + " EXCL"")")
            loDataProviderIndex.CommandTextAdd("EXECSCRIPT(""DELETE TAG ALL"")")

            loDataProviderTag.ParameterAdd("NoTable", oRow("Numero"))
            If Not loDataProviderTag.SQLExec("SELECT Tag.Tag,Tag.Name FROM Tag " + _
             "WHERE Tag.NoTable=" + loDataProviderTag.ParameterAddSQL("NoTable")) Then
                Return False
            End If

            For lnCounter = 0 To loDataProviderTag.nCount - 1
                loRowTag = loDataProviderTag.oDataSet.Tables("Temp").Rows(lnCounter)
                loDataProviderIndex.CommandTextAdd("EXECSCRIPT(""INDEX ON " + Trim(loRowTag("Tag")) + " TAG " + Trim(loRowTag("Name")) + """)")
            Next

            loDataProviderIndex.CommandTextAdd("EXECSCRIPT(""USE"")")
loDataProviderIndex is just my data provider class. The key here is to add the all the commands in oCommand. I use also a method of the data provider class named CommandTextAdd(). Basically, this is a method that adds into a collection that is named oCommandText. Then, when I am ready to execute everything, I can scan the collection and do something like:
                ' Execute all commands
                For Each lcCommandText In oCommandText
                    oCommand.CommandText = lcCommandText
                    oCommand.ExecuteNonQuery()
                Next
Where oCommand is defined as:
Private oCommand As IDbCommand = Nothing
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform