main logo
Subject: Re: Views in Codemine 7.
Author: "Graham"
Posted: 2003/05/31 16:52:00
 
View Entire Thread
New Search


Hi all

This is a conversation I've been having with CM tech support, I'm a bit
confused by Dave Lehr's response on this one.

In a nutshell I am trying to achieve a seamless change of database by
building different data environment classes to access the relevant tables.
Also I have some customers who run my software on standalone pc's so I don't
need to go to the expense/hassle of local views and can just open the tables
directly.

I thought I could set the DBC to the views, call the view vTable_name and
then change its alias in the data environment. The code will pretty much
work as is.

I was sure I'd just created two classes for the data environment, one of
which accessed the tables directly and the other used the views and then
just swapped them in the load event to the one I wanted to use.

It may be that fox just cannot do what I am looking for but I would be
surprised if that were the case.

I'd appreciate any comments

Regards
Graham


----- Original Message -----
From: "CodeMine Support" <Support (AT) codemine .D.OT com>
To: "Graham" <gbrown@compsys.co.uk>
Sent: Saturday, May 31, 2003 9:29 PM
Subject: Re: Views


> > CASE PARAM.PCODE="1"
> > Does this mean that I have to go through all the code in all the methods
> > and change that to
> > CASE VPARAM.PCODE="1"
>
> Yes, otherwise you would be accessing the table and not the view.
>
> > All the controlsources on the forms are bound to Param.
> > Doesn't that mean I also have to go through each one of those and change
the
> > control source to vParam.?
>
> Yes.
> The view cursor cannot have the same alias name as the table for any view.
> Every cursor in a VFP datasession needs a unique alias.
>
> > This would mean as well as having different dbcs for views and tables
(which
> > is okay) different screens for those that talk direct to the tables and
> > those that talk to the views.
>
> Yes, although you would normally not do both. Use lcoal views for the VFP
table
> version and remote views for the SQL Server version. You can never use
tables
> directly if this is the model you want to follow.
>
> You will likely need to change a lot more than the alias names anyway,
since many
> of the techniques you use for direct table access will not work well when
using
> views. For example, pulling all the records and navigating through them
> sequentially works fine for direct table access, but not for views. You
need an
> alternate record selection strategy for views. Whether the views local or
remote
> or defined via CursorAdaptors, the end result is the same.
>
> -Dave
> Tech Support
>
>
>




 
©2003 Graham
<-- Prior Message New Search Next Message -->