Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I must be missing something basic ?
Message
 
 
À
13/10/1999 09:27:07
Bruce Covey
Home Depot Television
Atlanta, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00275770
Message ID:
00275789
Vues:
21
>In my Project Mgr. I have the .dbc I am using and it is EXCLUDED.
>I have this .dbc stored in two locations ( one of which has sample data )
>
>I have a "PATH =" statement in my Config.fpw file pointing to the live data location. However, if I change the path statement to the sample location, it doesn't recognize it.
>
>I took a class with John Petersen in Atlanta, and he mentioned something about this, but I can't remember what it was.
>
>Any help is appreciated.
>
>Bruce Covey

If you let the form DE handle the opening of tables for, the path to the DBC is included in the cursor's properties. To understand better, do the following:

use myform.scx
set filter to class='cursor'
locate
edit properties

See the DATABASE property? You have to strip that path from the DBC name. I use the following code to do this for me:
set talk off
set deleted on
local lnRetVal, i, j, lcFile, llFound, lcStr, lcPath
local array laFiles(1,2)
cd forms   && change to my forms folder
lnRetVal = adir(laFiles, "*.scx")
for i = 1 to lnRetVal
    lcFile = laFiles(i,1)
    use (lcFile) excl
    locate for "DATABASE" $upper(Properties)
    do while !eof()
        llFound = .f.
        for j = 1 to memlines(properties)
            if alltrim(upper(substr(mline(properties, j), 1, 8))) = "DATABASE"
                llFound = .t.
                exit
            endif
        next
        if llFound
            lcStr = mline(properties, j)
            lcStr = alltrim(substr(lcStr, 11))
            lcPath = justpath(lcStr)
            lcPath = addbs(lcPath)
            replace next 1 properties with strtran(properties, lcPath, "")
        endif
        continue
    enddo
    pack
    use
    compile form (lcFile)
next
cd ..
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform