Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 To: Argie Badua
  Where is Argie Badua?
 Banna, Ilocos Norte
 Philippines
 Argie Badua
 Tags
Subject: RE: database sharing
Thread ID: 22227 Message ID: 22249 # Views: 46 # Ratings: 0
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Sunday, April 13, 2003 6:23:52 AM         
   


> > i am using a listbox to display the changes in database that is being made by multiple user. I make the listbox refresh every 2 seconds. But it appears that, i cannot open the compiled exe file if i had already open one. I suspect that is the database cannot be shared. So i try put "shar" for the database ...it still doens't works. can anyone help? thanks
> >
> > grayson
>
>
> Actually i havent use database yet, but wat i use is free tables, when sharing free tables just issue the shared word when opening(issuing USE) the table and it works well.
> Hope it helps...:)


Hi,

Not sure what your problem is, but:
Ensure in your Main.prg startup program you got EXCLUSIVE OFF
Below is an example of a basic startup prg. I alway call it Main from my C programming
background.


* --- Main.prg - To startup this application
* --- Set development flag for VFP debugging
PUBLIC xdevelop
* --- Set this flag to .T. for interactive running witbin VFP
xdevelop=.F.
* --- Development flag
IF xdevelop=.F.
SET DEVELOPMENT OFF && Turn off development mode
ELSE
SET DEVELOPMENT ON
SET DEBUG ON
_VFP.EditorOptions = "" && Turn off Intelisense
ENDIF

* --- Global system environmental settings
SET RESOURCE ON && Resource file to default
SET BELL ON && Turn on bell
SET CONSOLE OFF && Turn off the console
SET TALK OFF && Surpress talk back on screen
SET DATE ANSI && Year.Mo.Dy format
SET CENTURY ON && Set to full century for year 2000
SET STATUS BAR ON && Show status bar
SET SAFETY OFF && No prompt on file overwrites
SET SAFETY OFF && Allow file deletions
SET HELP ON && Place help on
SET HOURS TO 12 && Use the 12 hour clock
SET DELETED ON && Do not show deleted records
SET MULTILOCKS ON && Allows multiple record locks on network
SET REFRESH TO 4,2 && Refresh wait 4 sec on network, 2 sec local
SET EXCLUSIVE OFF && Allow multiple user access
SET ESCAPE OFF && Allow exit via Escape key
SET MEMOWIDTH TO 80 && Set width of memo fields printing to 80
SET CARRY OFF && New records are blank
SET REPROCESS TO 25 && Number of times to attempt locking
SET SYSMENU OFF && Turn of the VFP menu


* --- Nill out all function key operations
ON KEY LABEL F1
ON KEY LABEL F2
ON KEY LABEL F3
ON KEY LABEL F4
ON KEY LABEL F5
ON KEY LABEL F6
ON KEY LABEL F7
ON KEY LABEL F8
ON KEY LABEL F9
ON KEY LABEL F10
ON KEY LABEL F11
ON KEY LABEL F12

* --- Disk space test and reminder
xdsk=DISKSPACE()
IF xdsk < 200000000
=MESSAGEBOX('Warning: You have less that 100 meg of free disk ;
space on the drive where this program exists. Once the ;
free space gets low, problem could result that could corrupt ;
data, or loose data. Free up disk space immediately !',0+16,'Free Disk Space Warning !')
ENDIF

* --- Set main window screen attributes
*_screen.visible=.F.
_screen.windowstate=2 && Force full screen
_screen.closable=.F. && Do not allow closing main screen
_screen.backcolor=RGB(128,128,128) && Set system window back color
_screen.caption="My program" && Main Window Title

* --- Assign global memory variables
PUBLIC xroot, xmess_string, xcompany
PUBLIC xcopyright, xversion
xroot=SYS(5)+CURDIR() && Startup directory, or use Home()
xroot=RTRIM(xroot)
nlgth=LEN(xroot)
xroot=SUBSTR(xroot,1,nlgth-1)

* --- Set system folders default paths
SET DEFAULT TO &xroot
SET PATH TO &xroot

* --- Call the Main form
DO Form frmMain
READ EVENTS

In your form with the listbox ensure the table is in the forms data environment and not set
as exclusive and set buffering = 5.
Your timer event should issue the following every 2 seconds:

Thisform.mylistbox.Refresh

However, once the listbox has the focus you want to set the timer interval = 0 in the Gotfocus event
so it does not refresh while a user is picking. On the lostfocus event of the listbox
set the timer interval back to 2 seconds.

Pete from the Great White North. (Only in Canada, ay.) Over and Out ...


COMPLETE THREAD

database sharing Posted by Grayson Tang @ 4/12/2003 6:32:05 AM
RE: database sharing Posted by Argie Badua @ 4/12/2003 4:20:52 PM
RE: database sharing Posted by Pete Sass @ 4/13/2003 6:23:52 AM