Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexing a table from OleDb
Message
 
 
À
17/04/2007 22:20:34
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
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01153964
Message ID:
01217155
Vues:
7
I see, thanks a lot. I was thinking of a slightly simpler approach, that seems to work: create a text file with all commands and just use execscript(filetostr('CommandFile')) FILETOSTR is not listed as unsupported command, so this approach, essentially, allows executing any script. But perhaps this command is not supported, just not listed in unsupported.

>>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
>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform