View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
 Good Morning,

I use "sele 1", and "sele 2" instead of the "sele 0" out of force of habit. When I started writing dBase code way back in the dark ages, there was no sele 0.

Anyway, I changed my openDBFs() to all "sele 0" thus:

if !used("PEOPLE")
  sele 0
  use .\database\people alias PEOPLE
endif
if !used("WORKORDERS")
  sele 0
  use .\database\workOrders alias WORKORDERS
endif
if !used("PRICES")
  sele 0
  use .\database\prices alias PRICES
endif
...

I'll report back if that makes my problem vanish.

Ciao,

Alden
Sent by FoxWeb Support on 07/06/2006 06:13:19 PM:
Why are you specifying work areas by number when opening tables?  I'm including the the code of our OpenTable function, which we use in a bunch of our applications:
 

OpendDBFS.prg
  DO OpenTable WITH '.\database\people', 'PEOPLE', .F.

  DO OpenTable WITH '.\database\workOrders', 'WORKORDERS', .F.

RETURN .T.

 

 

***********************************************************
PROCEDURE OpenTable
  * Opens a table if it is not already open
  LPARAMETERS FilePath, Alias, Exclusive
  IF TYPE("M.alias") <> "C"
    M.alias = JustFName(JustStem(M.FilePath))
    IF '!' $ M.alias
      * Strip database delimiter
      M.alias = SUBSTR(M.alias, RAT('!', M.alias) + 1)
    ENDIF
  ENDIF
  IF USED(Alias)
    SELECT (Alias)
    IF FULLPATH(DBF()) <> FULLPATH(M.FilePath) OR (M.Exclusive <> ISEXCLUSIVE())
      IF M.Exclusive
        USE (M.FilePath) AGAIN ALIAS (M.Alias) EXCLUSIVE
      ELSE
        USE (M.FilePath) AGAIN ALIAS (M.Alias) SHARED
      ENDIF
    ENDIF
  ELSE
    SELECT 0
    IF M.Exclusive
      USE (M.FilePath) AGAIN ALIAS (M.Alias) EXCLUSIVE
    ELSE
      USE (M.FilePath) AGAIN ALIAS (M.Alias) SHARED
    ENDIF
  ENDIF
ENDPROC

 

FoxWeb Support Team
support@foxweb.com email

Sent by on 07/06/2006 02:04:09 PM:
Hello,

I'm getting a perplexing intermittent error:

 There was an error during the interpretation of your request.

Error #:              13
Message:         Alias 'WORKORDERS' is not found.
Program:         c:\inetpub\potter\stoutmarinedatabase\mgmt.fxp
Line #:         9
Line:         sele WORKORDERS

If I hit the browser's refresh the error vanishes and all works fine.

mgmt.fwx
line 8 =openDBFs()
line 9 sele WORKORDERS

opendDBFS.prg
if !used("PEOPLE")
  sele 1
  use .\database\people alias PEOPLE
endif
if !used("WORKORDERS")
  sele 2
  use .\database\workOrders alias WORKORDERS
endif
retu(.t.)