Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Chris
  Where is Chris?
 
 North Carolina - United States
 Chris
 Tags
Subject: RE: accessing foxpro tables from VB .Net
Thread ID: 154685 Message ID: 155202 # Views: 3 # Ratings: 0
Version: Visual FoxPro 8 Category: ODBC, ADO and OLEDB
Date: Thursday, December 27, 2007 3:46:45 PM         
   


> >
> > Parameterizing wasn't about speed.
> >
> > For one record it doesn't matter. If it was large a DataReader is the fast forward data retrieval way.
> >
> > Looking back again to your SQL I noticed you have an unnecessary join with another table. Isn't it the same query with this one:
> >
> >
fields = _
> > "select custno, lastpay, balance from ('f:\arcust01') where custno = '9128675309'"
> > 

> > I expect 1 record to be returned in less than a second provided there is an index on custno.
> >
> > Cetin Basoz
>
>
> Actually no, because that number might be in BTN but not in arcust01. BTN will probably contain all records I'd search for but arcust01 is very likely not to contain matches. Also again this little program is only meant to prove I can retrieve data from multiple VFP tables residing on different drives etc from within VB with usable response times. It is only a test. This test has to data revealed that oledb can't but odbc can retrieve the data effectively. oledb takes about 2 minutes. odbc took .09 of a second!

No, IMHO that test reveals only that there is something you're missing in your test setup. VFPOLEDB DO use the indexes and return results fast. Here is a test code I just tried (paths and tablenames are replaced with fake ones). VFP returns result in 0.108. .Net returned in 0.165 (tables had 77+K records).

using System;
using System.Data;
using System.Data.OleDb;
using System.Diagnostics;

class sample
{
 static void Main()
 {
     Stopwatch tmr = new Stopwatch();
    tmr.Start();
  OleDbConnection con = new OleDbConnection(@"Provider=VFPOLEDB;Data Source=\\myserver\myShare\myDatabase.dbc");
   OleDbCommand cmd = new OleDbCommand("select t1.* from table1 t1 "+
      @" inner join ('d:\myFolder\myTable') t2"+
       "   on t1.pkid = t2.fkid"+
       " where t1.pkId ==?",con);
   cmd.Parameters.AddWithValue("p1","CQLLDR");
   con.Open();
   OleDbDataReader rdr = cmd.ExecuteReader();
   DataTable tbl = new DataTable();
   tbl.Load(rdr);
   rdr.Close();
   con.Close();
   tmr.Stop();
   Console.WriteLine("Elapsed milli: {0}",tmr.ElapsedMilliseconds);
   
   foreach(DataRow row in tbl.Rows)
   {
     Console.WriteLine("{0}:{1} {2}",
       row[0],
       row[1], 
       row[2]);
    
   }
 }
}


Cetin Basoz

ENTIRE THREAD

accessing foxpro tables from VB .Net Posted by Chris @ 12/18/2007 7:58:03 PM
RE: accessing foxpro tables from VB .Net Posted by Eric den Doop @ 12/18/2007 8:15:16 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/19/2007 4:46:50 PM
RE: accessing foxpro tables from VB .Net Posted by Eric den Doop @ 12/19/2007 5:11:37 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/19/2007 9:24:50 PM
RE: accessing foxpro tables from VB .Net Posted by Borislav Borissov @ 12/19/2007 9:38:14 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/19/2007 9:43:45 PM
RE: accessing foxpro tables from VB .Net Posted by Borislav Borissov @ 12/19/2007 9:50:32 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/19/2007 10:32:23 PM
RE: accessing foxpro tables from VB .Net Posted by suhas hegde @ 12/19/2007 9:56:25 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/20/2007 4:24:34 PM
RE: accessing foxpro tables from VB .Net Posted by suhas hegde @ 12/20/2007 8:27:33 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/26/2007 9:54:59 PM
RE: accessing foxpro tables from VB .Net Posted by suhas hegde @ 12/27/2007 5:23:09 AM
RE: accessing foxpro tables from VB .Net Posted by suhas hegde @ 12/19/2007 5:44:20 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/19/2007 9:23:06 PM
RE: accessing foxpro tables from VB .Net Posted by Eric den Doop @ 12/19/2007 9:57:00 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/19/2007 10:54:01 PM
RE: accessing foxpro tables from VB .Net Posted by Cetin Basoz @ 12/19/2007 7:13:44 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/19/2007 9:00:21 PM
RE: accessing foxpro tables from VB .Net Posted by Cetin Basoz @ 12/19/2007 9:59:48 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/20/2007 5:01:14 PM
RE: accessing foxpro tables from VB .Net Posted by Cetin Basoz @ 12/27/2007 3:46:45 PM
RE: accessing foxpro tables from VB .Net Posted by Cetin Basoz @ 12/18/2007 8:54:59 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/19/2007 4:48:41 PM
RE: accessing foxpro tables from VB .Net Posted by tushar @ 12/19/2007 1:38:29 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/19/2007 4:35:12 PM
RE: accessing foxpro tables from VB .Net Posted by Cetin Basoz @ 12/19/2007 4:38:01 PM
RE: accessing foxpro tables from VB .Net Posted by Chris @ 12/19/2007 4:49:56 PM
RE: accessing foxpro tables from VB .Net Posted by tushar @ 12/20/2007 6:00:50 PM
RE: accessing foxpro tables from VB .Net Posted by William Sanders @ 12/19/2007 6:25:07 PM