Re: Slow queries between VB and VFP

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



jens.kristoffersson@xxxxxxxxx's wild thoughts were released
on 10 May 2006 07:27:30 -0700 bearing the following fruit:

Hi,
Im building a program that queries a visual fox pro databases (free
table). The largest database has around 80k entries with around 100
fields in each. Also there are several users on this database using
visual fox pro.

Reason I use visual basic 6 is because it was the only development tool
that was availible. My program actually worked very well with DOA on
copies of the databases locally and over the network.

Sadly I had worked with my program some weeks and this problem was
noticed when I installed on the clients (should note, network
connection in my office is 100mbit while the clients in production only
has 10mbit, so thats a problem)

I got an advice to use a OLE DB provider or a ODBC instead of DOA, fair
enough. I downloaded from microsoft a driver with version 6.01.8629.01
and it "works".

The small code below I just use to test the connection (maybe it doesnt
work, since I edited it here some). Anyways, fetching a single post
like this takes 10-30s, now thats on my 100mbit network cable, takes
around 10 times as long on the other clients.

So, any tips? Can it be antivirus problems, routers (I know there is
some problems with the network here), the program itself

How can I limit the network traffic? Any workarounds? I recently
relearned VB so im not that good at it atm, any advice is good.

Does this have to do with free tables and my program fetches the entire
database? (Because no server to run queries on?)

Also I should mention, I can not redesign the database since its used,
this is more or less a "patch" program im working on until the entire
system is changed in 6 months or so.

Also I tried VISDATA which comes with visual basic 6, same slow queries
on that particular database (local or network copies of database works
well).

#####################################################################
Private Sub Command1_Click()
Dim ad As ADODB.Connection
Dim ar As ADODB.Recordset

Set ad = New ADODB.Connection
ad.CursorLocation = adUseClient

Let ad.ConnectionString = "Provider=VFPOLEDB.1;Data
Source=N:\DB;Password=;Collating Sequence=General"

ad.Open

Set ar = New ADODB.Recordset

ar.CursorLocation = ADODB.adUseClient
ar.LockType = ADODB.adLockBatchOptimistic
ar.CursorType = ADODB.adOpenStatic

ar.Open "SELECT CNAME FROM CUSTOMER WHERE CNR='" + Text1.Text + "'", ad

Form1.Caption = ar.Fields(0).Value
End Sub

Is 'CNR' and indexed field?

If your query doesn't utilise an index on that table and
that table contains a lot of records then it will take time.



Jan Hyde (VB MVP)

--
"I'm going to kill Dracula," said Tom painstakingly. (Richard Lederer)

.



Relevant Pages

  • Re: Users locked out of secure DB
    ... what kind of systems do database managers use to ... once I start building queries on queries. ... >> copied to my workstations. ... >> not let me copy the database and paste over the network. ...
    (microsoft.public.access.security)
  • Re: No. of Users and Data Security
    ... and all the users are doing queries (not updates), and the network is ... Conversely, if the database is not structured correctly, or the code is ...
    (microsoft.public.access.security)
  • Re: Data Aware components for Fox Pro
    ... >Does anybody know where I can find data-aware components for Visual Fox Pro ... >I want to write a front-end application with a Visual FoxPro database. ... TDbf is compiled in the .exe whereas ADS requires a few .dll's. ...
    (alt.comp.lang.borland-delphi)
  • Re: Slow queries between VB and VFP
    ... Im building a program that queries a visual fox pro databases (free ... The largest database has around 80k entries with around 100 ... copies of the databases locally and over the network. ...
    (microsoft.public.vb.database.ado)
  • Slow queries between VB and VFP
    ... Im building a program that queries a visual fox pro databases (free ... The largest database has around 80k entries with around 100 ... copies of the databases locally and over the network. ...
    (microsoft.public.vb.database.ado)