Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming for shared access

Status
Not open for further replies.

KDavie

Programmer
Feb 10, 2004
441
US
I have been working diligently to learn VFP over the past month or so and have read several books, threads, and articles, I even purchased the VFP 6.0 training videos to help me along the way. In doing all that and getting help from the lot of you that I answered my questions along the way, I am finally ready (i think!) to start the development of my 1st real VFP application.

The application will be used for debt collection (basically I am rewriting an application I already wrote in MS Access). It will be programmed for shared acccess, which brings me to my questions:

First, would it be appropriate to use SET EXCLUSIVE OFF at the top of my main program?

Next, if I use the CURSORSETPROP() function in the init event of my forms will this take care of the buffering? (I will have buttons on the form that handle the saving and reverting of data.)

Also, how do I set the data path for the client side of the application?

Last, I am designing the application on my desktop, at home. When I take the application to work and put it on the server, it will have a new path. What should I do to prepare for this?

Forgive me for my ignorance. Although I have learned a lot in the past month, I am far from being a pro!

Thanks in advance for your help!

-Kevin


 
1. Yes, I always set EXCLUSE OFF in the main. If you wish to open a table exlcusively later use:

USE myTable EXCL

2. CURSORSETPROP() function is a nice way to use buffering to handle edit / revert. I often use it in the INIT event of my form. The TableUpdate / Tablerevert functions work on the table in the current work area, unless you speciify otherwise. Make sure you use it for all the tables that can be updated or reverted.

3. There are different ways to set path. Here is whay I do in my startup program.

* Set default to the program / exe startup directory
SET DEFA TO SYS(5)

* set the path to the startup, plus the subdirectories
SET PATH TO SYS(5)+SYS(2003) + ";data;progs;utils;forms;libs;reports;menus;graphics;"



Jim Osieczonek
Delta Business Group, LLC
 
One other point. If you use CURSORSETPROP() to set multi-row buffering, but sure to include:

SET MULTI LOCKS ON

in the startup program.

Jim Osieczonek
Delta Business Group, LLC
 
Thanks Jim!

If I include:

SET MULTI LOCKS ON

in the startup program (is the startup program my main.prg?),
will I need to SET MULTI LOCKS OFF and back on again when I am only atempting to lock 1 record?

Thanks,

-Kevin
 
Kevin, if you are going to use it for shared access in a network environment, I think it would be better if you use ODBC for VFP, and not just use the paths.

This will also give you better protection for your database records. Just a thought.
 
That is a matter of choice, but personally, I keep it set on.

I am not aware of any reason to set it off. Performance appears the same either way.

Others may know why you would set it off afterwards.



Jim Osieczonek
Delta Business Group, LLC
 
MadHatter2002,

I thought ODBC may be the way to go, I think that is the route I will take. I'm assuming the ODBC connection goes in my main.prg, so when the application is opened it connects to the datasource, right?

I've already finished designing the database (tables, relations, and RI), should I lay the pipe for the ODBC connection now and then begin designing all the forms, views, and reports?

Also, should I use remote views instead of tables for the data enviroment of my forms (it seems this would be more efficient).

Thanks everyone for your help!

-Kevin


 
It is looking like I am going to have to go with paths over ODBC. Apparently they have not updated the VFP ODBC drivers since 6.0 SR 5. Those drivers do not support autoinc integers. I downloaded the Microsoft OLE DB Provider for Visual FoxPro 8.0 which seemed to be the solution, but couldn't get that to work with that either. So unless you have another suggestion to make the ODBC connection work in VFP 8.0, I'm afraid I will have to settle on just providing the paths.

Thanks for your help

-Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top