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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SPT or Remote Views?

Status
Not open for further replies.

benasumwa

Programmer
Oct 14, 2003
57
KE

Hi Friends!

I have gathered quite some helpful hints from
you guys concerning client/server. I have decided
to change my applications (VFP6) to this architecture, may
be using VFP9. For learning purposes I have downloaded SQL Server 2005 Express Edition. Just to ask:

1). Out of your experiences, what technology works best,
SPT or RVs? (Maybe Pros&Cons?)

2). What would be your advice seeing am a new comer
into the SQL business?

Thanks in advance
Benson
 
1). Out of your experiences, what technology works best,
SPT or RVs? (Maybe Pros&Cons?)

Andy and I use a set of data classes that is a wrapper around SPT and it has worked very well for us in a number of applications that are now running all over the world.

You can download a public domain version of our data classes from the downloads page of our website along with sample code and a white paper that explains how to use them.

Marcia G. Akins
 
If you will using VFP9 CursorAdapters are the way :eek:))
More flexible then Views and SPT. You can have more control of what happens and how it happens :eek:))

Borislav Borissov
 
Benson,

Out of your experiences, what technology works best,
SPT or RVs? (Maybe Pros&Cons?)

Whichever one you feel more comfortable with. In fact, you might use a combination of the two.

Briefly, RVs have the advantage that they can be placed in the data environment of a form, which makes it much easier to bind controls to remote data. They are generally easier to manage, especially if you are converting exising code.

A big disadvantage of RVs is that, if you use them to insert or update records, and if you are using SQL Server's varchar data type, the RV won't respect that -- it will pad the field with spaces. This is less of a problem in VFP 9.0, because RVs can be made to support varchars. (For more on this, see
RVs can only be used for queries, inserts, updates and deletes. SPT can be used for any operation, including creating tables, managing logins and running stored procedures.

As Borislav points out, cursor adapters are another possibility, but these were only introduced in VFP 8.0. They have a few advantages but also a number of disadvantages of their own. I have never felt any compelling reason to use them for client/server work, but your situation might be different.

Hope this helps.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi Friends!


Thanks so much for your pieces of advice. I just had one more question. In my current applications, I explicitly open
the tables in the LoadEvent or InitEvent in this fashion

Code:
(I do not have DEs on forms)

For data entry purposes I SCATTER MEMVAR and bind the memvars to the controls which the users then edit and save
by GATHERing MEMVAR. SEEKs are also prevalent in the Apps. If I opted for RVs, what commands would not work and what would be there replacements. I am sounding dump but please
do not mind. Learning is a curve.

One again 1000 Thanks

Benson
 

Benson,

If you opt for remote views, your existing forms should work pretty much the same. Just open the view rather than the table. You shouldn't need to change any other code.

The main difference between RVs and tables is that you can't create a permanent index on a RV. You can do INDEX ON, but the index is lost when the view is closed. That means you might have re-think your use of SEEKs.

With client-server, a better approach is to use parameterised views, which means the view only contains those records that meet a given criterion. Most often, the view just contains a single record, as defined by the parameter. You never do a SEEK on the view. Instead, when you want to get the next record, you REQUERY() the view.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 

Hi Mike

I must say I am really impressed by your kind answers.
Thanks so much for your support.

In my post I indicated that I do not have DEs in my forms.
I just USE.

1. Is this a bad programming habit?
2. Any tradeoffs?
3. Ok for the RVs? (Use MyView In 0)

Thanks

Benson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top