Re: database - table references (VFP9)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



In VFP6 I solved this problem puting

close data all
m.ln=adir(frms,"forms\*.scx")
for i=1 to ln
use ("forms\"+allt(frms(i,1)))
scan for "..\" $ properties
do while "..\" $ properties
m.pos1=at("..\",properties)
m.st1=substr(properties,m.pos1)
m.pos2=at(chr(13),m.st1)
if m.pos>0
m.st1=left(m.st1,m.pos2-1)
endif
m.st2=justfname(allt(m.st1))
if m.pos2=0
replace properties with left(properties,m.pos1-1)+m.st2
else
replace properties with left(properties,m.pos1-1)+m.st2+ ;
substr(properties,m.pos1+m.pos2-1)
endif
enddo
endscan
use
endfor


in the BeforeBuild method of ProjectHook

Leonid


"Michael S. Jensen" <msj@xxxxx> wrote in message
news:e0p2PmRcFHA.2180@xxxxxxxxxxxxxxxxxxxxxxx
> Sure did - damn,
>
> Even AutoOpenTables=.F. followed by a manual call to OpenTables does not
> help much.
>
> It would have, if the data environments init method was called before any
> of
> the other controls init method - but no :-(
>
> /MSJ
>
>
> "Paul Pedersen" <no-reply@xxxxxxxx> wrote in message
> news:O95%23VWHcFHA.3404@xxxxxxxxxxxxxxxxxxxxxxx
>> You have just discovered why the data environment in forms is much less
>> useful than it should be.
>>
>>
>> "Michael S. Jensen" <msj@xxxxx> wrote in message
>> news:e8Rd4S%23bFHA.1504@xxxxxxxxxxxxxxxxxxxxxxx
>> > Tracked it down to being the way FoxPro handles a data-environment.
>> >
>> > Instead of looking in the current database for the relevant tables and
>> > their
>> > locations, it first looks in the folder where the table(s) where placed
>> > when
>> > initially adding them to the data-environent.
>> >
>> > Can probably solve it by changing the default folder so no longer an
>> > issue.
>> >
>> > /MSJ
>> >
>> >
>> > "Michael S. Jensen" <msj@xxxxx> wrote in message
>> > news:eZuuoQ2bFHA.3400@xxxxxxxxxxxxxxxxxxxxxxx
>> >> Hi,
>> >>
>> >> During runtime, an empty database is copied to some user-determined
>> >> location.
>> >>
>> >> The problem is that the application ends up using a mix of the old
>> >> database/table location (which is the location/tables used during
>> >> development) and the new one.
>> >>
>> >> SET("PATH") does not point at the orginal location.
>> >>
>> >> Using LIST DATABASE shows that the .DBC does not contain any
>> >> references
>> >> to
>> >> the original path. Not using ! in the FROM clause solves the problem
> for
>> > SQL
>> >> statements but form's still show data not present in the current
>> >> database.
>> >> So a candidate seems to be the data environement / cursor.database
>> > property.
>> >> But tried modifying the cursor.database property in the
>> >> BeforeOpenTable
>> >> method with no luck.
>> >>
>> >> Must be overlooking something, but what ?
>> >>
>> >> TIA
>> >> Michael S. Jensen
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>>
>>
>
>


.



Relevant Pages

  • Re: database - table references (VFP9)
    ... there are new classes that might make it less trouble. ... if the data environments init method was called before any ... >>> Instead of looking in the current database for the relevant tables and ... it first looks in the folder where the tablewhere placed ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Using external libraries (.lib files) in VFP
    ... Run it with an integer as parameter and it returns the folder name. ... Endif ... > Do you mean that I have to register the functions before calling them? ... >> API calls from VFP can be rather a bit difficult. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: In Outlook add a folder then move a message to it.
    ... This will give you the folder ID number. ... > oFolders =thisform.OLGetFolder ... > ENDIF ... >> This example moves the unread message to the folder that has an index of ...
    (microsoft.public.fox.vfp.forms)
  • Re: loMRead.Move(oFolders.Folders(cCase))
    ... > Trying t o move one message from the InBox to another folder in Outlook 2002 ... > ENDIF ...
    (microsoft.public.fox.vfp.forms)
  • Memstick storage driver in Release and debug mode
    ... I wrote MemoryStick driver for CE5.0 and its working fine in debug ... While trying to create new folder one small window pops up and shows ... I m not getting any debug messages written in DSK_IOControlfunction ... ENDIF BSP_NOMEMSTICK! ...
    (microsoft.public.windowsce.platbuilder)