Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Make the form stop hard coding table path
Message
From
16/04/2002 03:58:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00645079
Message ID:
00645317
Views:
9
>>>I have an app I'm attempting to distribute, but the form is hard coding the table's location (path). The table is not part of a database. Is there a way I can replace the cursorsource in the dataenvironment with justfname(cursorsource) for all tables then run opentables()? I've done this when a file is part of a database by setting the database, but I can't figure out how to do this when the files are not members of a database. Your would think/hope VFP would use relative location unless otherwise specified. Thanks!
>>
>>Set Database property to '' and CursorSource to fullpath of dbf.
>>
>>thisform.DE.Closetables
>>* Loop and change cursor props
>>thisform.DE.Opentables
>
>I need more help with this loop...how can I loop through tables in dataenviroment without specifing the tables specificially and set their respective properties?
>
>Thanks!
lnMembers = amembers(arrMbrs,thisform.Dataenvironment,2)
lcNewPath = getdir()
with thisform.Dataenvironment
 .CloseTables
 for ix=1 to lnMembers
  with evaluate('.'+arrMbrs[ix])
   if lower(.Baseclass) == 'cursor'
     .CursorSource = lcNewPath+justfname(.CursorSource)
   endif
  endwith
 endfor
 .OpenTables
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform