Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Path help ....
Message
From
28/09/1998 13:18:16
 
 
To
28/09/1998 12:55:14
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00141517
Message ID:
00141525
Views:
29
{snip}

>In my application, I specificly open up the dbc using 'open database ..\dbf\app.dbc' at the beginning of the program. This doesnt seem to work as expected.
>
>
>Any help is appreciated ....
>
>Thanks

I wrote a class that I add to my forms that set the DBC path and the name for the DE cursors at runtime from the app object. This is a snippet from it. Maybe this will help.

**-- Method SetDBC
*
lparameters tcDBCPath,;
tcDBCName

local lcObject,;
lcDEObject,;
lcExString,;
laObjectList,;
laObjectDEList,;
i,;
j

**-- Check parinfo for more than 1
**-- if only one parameter sent, default the DBC path.
*
tcDBCPath = iif( pcount() == 1, fullpath(curdir()),addbs(alltrim(tcDBCPath)) )

dimension laObjectList[1]

if amembers(laObjectList,ThisForm,2) < 1

return(.F.)

endif

if ascan(laObjectList,'DATAENVIRONMENT') > 0

**-- DE Objects
*
dimension laObjectDEList[1]

**-- Does the DE have any objects?
*
if amembers(laObjectDEList,ThisForm.DataEnvironment,2) < 1
return(.F.)
endif

**--loop through the cursors objects and set the DBC
*
for j = 1 to alen(laObjectDEList,1)

lcDEObject = evaluate('ThisForm.DataEnvironment.' + laObjectDEList(j))
if upper(lcDEObject.baseclass) = "CURSOR"

if upper(right(alltrim(tcDBCName),3)) = 'DBC'
lcDEObject.Database = tcDBCPath + tcDBCName
else
lcDEObject.Database = tcDBCPath + tcDBCName + '.dbc'
endif

next

else

return(.F.)

endif

return(.T.)

**

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform