Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lookup from a view
Message
De
13/01/2005 15:32:17
 
 
À
13/01/2005 15:29:30
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Divers
Thread ID:
00976908
Message ID:
00976915
Vues:
34
>In oData, is the combination of key + module guaranteed to be unique? If so, I'll give you a FIND (i.e. seek) example...if it's not unique, I'll give you a rowfilter one.
>
>I noticed you stopped after the first hit...so I'm guessing it's unique, but wanted to ask...

Yes, it is unique.

I optimized the routine like this:
        Dim lnCounter As Integer
        Dim lcString As String
        Dim lcKey As String
        Dim lcModule As String
        lcString = tcKey
        lcKey = UCase(tcKey).PadRight(25, " ")
        lcModule = UCase(tcModule).PadRight(20, " ")
        For lnCounter = 0 To oData.Count - 1
            If oData(lnCounter).Row("Key") = lcKey And oData(lnCounter).Row("Module") = lcModule Then
                Select Case tnLanguage

                    ' French
                Case 1
                        lcString = oData(lnCounter).Row("French")

                        ' English
                    Case 2
                        lcString = oData(lnCounter).Row("English")

                End Select
                Exit For
            End If
        Next
        Return Trim(lcString)
That assumes that the data adapter is including a SQL like this:
        oData = Framework.VFPSQLAdapterDataView("SELECT UPPER(Key) AS Key,UPPER(Module) AS Module,French,English FROM Message", toForm.lcStartupDirectory)
If I wouldn't put the UPPER() here but would have placed it in the routine, the process time is 4 times slower. It is surprising how sensitive the data process could be slow for such small things as oppose to VFP.

But, we'll optimize it more based on your upcoming reply. I'll wait for your sample.
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform