Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

ODBC in VFP8 - a hint and a question

4 posts in FoxPro Last posting was on 2004-10-07 16:34:22.0Z
tom knauf Posted on 2004-09-01 08:58:58.0Z
From: "tom knauf" <tom.knauf@itds.de>
Newsgroups: Advantage.FoxPro
Subject: ODBC in VFP8 - a hint and a question
Date: Wed, 1 Sep 2004 10:58:58 +0200
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 217.227.11.253
Message-ID: <41358ec2@solutions.advantagedatabase.com>
X-Trace: 1 Sep 2004 02:56:34 -0700, 217.227.11.253
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!217.227.11.253
Xref: solutions.advantagedatabase.com Advantage.FoxPro:187
Article PK: 1109542

Hi there,

we use ADS6.2 with latest ODBC-drivers on win2K server.

Hint
----
After some days of trying we found out as follows :
Generate the connection via odbcad32
Create the remote view in VFP7, SP1 with the view designer

you can now use the remote view in VFP8 (SP1) as usually, but :
NEVER TRY TO MODIFY the view in VFP8, this crashes foxpro and DAMAGES the
database (dbc) so we could (sometimes) not acces it with vfp7/vfp8 anymore.

When creating the view you may not use literals in the sql like "Where
country="Brazil"", ads gives an error and you cannot save. You may use where
Country =?cCountry. This works asking you for a value (in the designer) or
taking a predefined value.


Question
---------
We use a grid to show our users all possible customers (>100.000)
If I use the nativeVFP tables as recordsource in a grid, the grid appears at
once and the data is loaded when I scroll.
If I use the remote view, it takes up to 20 seconds (same data) until the
grid appears and data is loaded continuously in the backround even if I do
not scroll.
I hope I can stop that, but how ?

Greetings
tom


Alex Wong (ADS) Posted on 2004-09-15 14:49:25.0Z
From: "Alex Wong \(ADS\)" <alexw@extendsys.com>
Newsgroups: Advantage.FoxPro
References: <41358ec2@solutions.advantagedatabase.com>
Subject: Re: ODBC in VFP8 - a hint and a question
Date: Wed, 15 Sep 2004 08:49:25 -0600
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 198.102.102.17
Message-ID: <414854da@solutions.advantagedatabase.com>
X-Trace: 15 Sep 2004 08:42:34 -0700, 198.102.102.17
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!198.102.102.17
Xref: solutions.advantagedatabase.com Advantage.FoxPro:188
Article PK: 1109544

Hi Tom,

"tom knauf" <tom.knauf@itds.de> wrote in message
news:41358ec2@solutions.advantagedatabase.com...
> Hi there,
>
> we use ADS6.2 with latest ODBC-drivers on win2K server.
>
> Hint
> ----
> After some days of trying we found out as follows :
> Generate the connection via odbcad32
> Create the remote view in VFP7, SP1 with the view designer
>
> you can now use the remote view in VFP8 (SP1) as usually, but :
> NEVER TRY TO MODIFY the view in VFP8, this crashes foxpro and DAMAGES the
> database (dbc) so we could (sometimes) not acces it with vfp7/vfp8
anymore.
>

Advantage has no knowledge of the dbc so I would not recommend using dbc
with Advantage. Free table should work fine with Advantage.



> When creating the view you may not use literals in the sql like "Where
> country="Brazil"", ads gives an error and you cannot save. You may use
where
> Country =?cCountry. This works asking you for a value (in the designer) or
> taking a predefined value.
>

I think the problem is that with Advantage, the string literal must be
enclosed in single quotes instead of the double quotes, i.e. count='Brazil'
should work.

>
> Question
> ---------
> We use a grid to show our users all possible customers (>100.000)
> If I use the nativeVFP tables as recordsource in a grid, the grid appears
at
> once and the data is loaded when I scroll.
> If I use the remote view, it takes up to 20 seconds (same data) until the
> grid appears and data is loaded continuously in the backround even if I do
> not scroll.
> I hope I can stop that, but how ?
>

Sorry, I don't have any good idea on this. It may be how ODBC works in VFP
so you may get better answers in newsgroups specific to VFP.

Alex Wong
Advantage R&D


tom knauf Posted on 2004-10-06 09:27:33.0Z
From: "tom knauf" <tom.knauf@itds.de>
Newsgroups: Advantage.FoxPro
References: <41358ec2@solutions.advantagedatabase.com> <414854da@solutions.advantagedatabase.com>
Subject: Re: ODBC in VFP8 - a hint and a question
Date: Wed, 6 Oct 2004 11:27:33 +0200
Lines: 84
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 217.81.77.95
Message-ID: <4163baca@solutions.advantagedatabase.com>
X-Trace: 6 Oct 2004 03:28:42 -0700, 217.81.77.95
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!217.81.77.95
Xref: solutions.advantagedatabase.com Advantage.FoxPro:189
Article PK: 1109543

Hi Alex,

this is a misunderstanding :

1. Views and dbc corruption
Of course we only use free tables, but the view/connection definitions are
stored in the dbc.
Its just an information about a foxpro-bug.

2. Grid loading all entrys
Do you have a hint for our problem with ADS sending all entrys to our grid ?

Greetings
tom



"Alex Wong (ADS)" <alexw@extendsys.com> schrieb im Newsbeitrag
news:414854da@solutions.advantagedatabase.com...

> Hi Tom,
>
> "tom knauf" <tom.knauf@itds.de> wrote in message
> news:41358ec2@solutions.advantagedatabase.com...
> > Hi there,
> >
> > we use ADS6.2 with latest ODBC-drivers on win2K server.
> >
> > Hint
> > ----
> > After some days of trying we found out as follows :
> > Generate the connection via odbcad32
> > Create the remote view in VFP7, SP1 with the view designer
> >
> > you can now use the remote view in VFP8 (SP1) as usually, but :
> > NEVER TRY TO MODIFY the view in VFP8, this crashes foxpro and DAMAGES
the
> > database (dbc) so we could (sometimes) not acces it with vfp7/vfp8
> anymore.
> >
>
> Advantage has no knowledge of the dbc so I would not recommend using dbc
> with Advantage. Free table should work fine with Advantage.
>
>
>
> > When creating the view you may not use literals in the sql like "Where
> > country="Brazil"", ads gives an error and you cannot save. You may use
> where
> > Country =?cCountry. This works asking you for a value (in the designer)
or
> > taking a predefined value.
> >
>
> I think the problem is that with Advantage, the string literal must be
> enclosed in single quotes instead of the double quotes, i.e.
count='Brazil'
> should work.
>
> >
> > Question
> > ---------
> > We use a grid to show our users all possible customers (>100.000)
> > If I use the nativeVFP tables as recordsource in a grid, the grid
appears
> at
> > once and the data is loaded when I scroll.
> > If I use the remote view, it takes up to 20 seconds (same data) until
the
> > grid appears and data is loaded continuously in the backround even if I
do
> > not scroll.
> > I hope I can stop that, but how ?
> >
>
> Sorry, I don't have any good idea on this. It may be how ODBC works in VFP
> so you may get better answers in newsgroups specific to VFP.
>
> Alex Wong
> Advantage R&D
>
>
>


Alex Wong (ADS) Posted on 2004-10-07 16:34:22.0Z
From: "Alex Wong \(ADS\)" <alexw@extendsys.com>
Newsgroups: Advantage.FoxPro
References: <41358ec2@solutions.advantagedatabase.com> <414854da@solutions.advantagedatabase.com> <4163baca@solutions.advantagedatabase.com>
Subject: Re: ODBC in VFP8 - a hint and a question
Date: Thu, 7 Oct 2004 10:34:22 -0600
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 198.102.102.38
Message-ID: <41656e5a@solutions.advantagedatabase.com>
X-Trace: 7 Oct 2004 10:27:06 -0700, 198.102.102.38
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!198.102.102.38
Xref: solutions.advantagedatabase.com Advantage.FoxPro:190
Article PK: 1109545


"tom knauf" <tom.knauf@itds.de> wrote in message
news:4163baca@solutions.advantagedatabase.com...
> Hi Alex,
>
> this is a misunderstanding :
>
> 1. Views and dbc corruption
> Of course we only use free tables, but the view/connection definitions are
> stored in the dbc.
> Its just an information about a foxpro-bug.
>
> 2. Grid loading all entrys
> Do you have a hint for our problem with ADS sending all entrys to our grid
?
>

Advantage does not send data to the client until the client requests it. So
this seems to me that VFP is trying to load all the data from the remote
view. I am going on a hunch (an educated one) here - with many types of grid
implementation, an attempt will be made initially to obtain the total number
of rows in the data set for the purpose of placing the scroll bar of the
grid at the correct position. With a native table, this can be done very
efficiently using the record count. With an remote view, i.e. an SQL query,
the grid may not know how to obtain the total count and it may resort to
reading all rows first to obtain this number, thus incurring the huge cost
at the beginning. If the remote view is an Advantage live cursor, the grid
should be able to get the total row count very efficiently using the ODBC
SQLGetDiagField API without resorting to reading all rows. If a remote view
using MS ODBC driver accessing native VFP table is fast (that seems to be
what you said), then this looks like the Advantage ODBC driver is not
reporting things correctly. I will suggest that you make a re-creation that
illustrate the difference between the MS ODBC driver and ADS ODBC driver and
send them to your support provider and we will investigate. If the MS ODBC
driver and the ADS ODBC driver behave the same then the problem lies in the
grid implementation.

HTH.

Alex