473,785 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

index to foxpro files

i need to access a legacy database that uses dBase files running under
foxpro for read only purposes, within net 2.0, ado 2.0, and sql
statements. i have no problem getting the info i need, but it is very slow.
i'm not using any indexes which the databases have, *.idx files, i don't
know how to access them.

the connection string i use is:

Provider=Micros oft.Jet.OLEDB.4 .0;Extended Properties=dBAS E
IV;User ID=Admin;Passwo rd=;Data Source=""M:\Nam es\""

M is a network drive, Names is the folder name where the databases are.

how do i make my data access go thru the indexes, do i change the connection
string, or the sql statement, or something else? i would appreciate a code
snippet.

thanks

ray

Mar 7 '07 #1
1 2567
Hi,

"ray well" <no****@nospam. comwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>i need to access a legacy database that uses dBase files running under
foxpro for read only purposes, within net 2.0, ado 2.0, and sql
statements. i have no problem getting the info i need, but it is very
slow.
i'm not using any indexes which the databases have, *.idx files, i don't
know how to access them.

the connection string i use is:

Provider=Micros oft.Jet.OLEDB.4 .0;Extended Properties=dBAS E
IV;User ID=Admin;Passwo rd=;Data Source=""M:\Nam es\""

This is the code I use to read from a foxpro table , SourceFile is the path
to the table you want. TableName is a method that return the name of the
table.

string connString;
OleDbConnection conn;
OleDbDataAdapte r adapter;

connString = "Provider=VFPOL EDB.1;Data Source="+ sourceFile + ";";
conn = new OleDbConnection ( connString);

adapter = new OleDbDataAdapte r( "select * from " + TableName(sourc eFile),
conn);
adapter.Fill( data, tablename);

string TableName( string sourceFile)
{
int lastIndex = sourceFile.Last IndexOf(@"\") +1;
return sourceFile.Subs tring( lastIndex, sourceFile.Leng th - lastIndex-4);

}
Mar 7 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6155
by: Matt Young | last post by:
I've been tasked with integrating an older management system based on DBF files with my snappy new ASP application to provide users of the ASP application with real-time data from the management system. I figure with DBF files, I should use either the DBase drivers or the FoxPro drivers to connect to the database. The integration has gone quite smoothly until yesterday. This means that my connection strings work well based on the...
1
2315
by: Steve Perry | last post by:
Hi, I have a large FoxPro table with an index that I need to be Queried from SQL Server by OLE.DB or ODBC. If I query the DBF directly a search takes 1 Minute +. Is there a way I can call the data from the table and use the existing FoxPro Index? Thanks Steve
1
2338
by: jdola | last post by:
I have a customer that is using Access to create reports from FoxPro tables. We started noticing problems with the indexes on the FoxPro tables. It is to the point where we have to delete and rebuild the indexes on a nightly basis. We cannot determine if Access is the culprit and I have not been able to look at the Access reports and determine how he is linking to the tables. I realize this is not much to go on, but does anyone see any...
2
5632
by: NOSPAMrclark | last post by:
I am looking for information on how to deal with dbase index files (cdx) when modifying data in dbase database files (dbf). I have an application with hundreds of .dbf files that I need to modify from time to time in a way that the application wont allow. I want to use access to add records, delete records, modify, etc, but I'm clueless on how to deal with the cdx and key files that accompany each dbf file. If someone could shed some light...
3
9895
by: Amar | last post by:
I have a abc.PRG file in visual foxpro 8.0. I can run this file using visual foxpro environment and it creates a table X.dbf in the same folder where this program file is and populates some data in the table. I want a way to run this abc.PRG file through VB.net environment. (Equivalent method to perform same as "DO abc.prg" command in foxpro). Please help me. Thanks in advance.
6
417
by: Karl O. Pinc | last post by:
These seem to work. I'm posting them now before I'm done with them before I start messing them up with specifics to my database. Any comment is welcome. However, I've no intention of publishing production quality code or documentation, these are my notes and I've used published them here in the event that somebody finds them useful. Postgresql developers might note the hackery required to accomodate COPY's insertion of escape...
0
1323
by: xscope | last post by:
Hi, I don't know if this is the correct group to post this. I have the following enviroment :- Server A - Windows 2000 Server SP4 - Running Business Objects Enterprise 11 Server B - Windows 2000 Server SP4 - File server holding Visual Foxpro data.
1
1258
by: ray well | last post by:
i need to access a legacy database that uses dBase files running under foxpro for read only purposes, within net 2.0, ado 2.0 using vb and sql statements. i have no problem getting the info i need, but it is very slow. i'm not using any indexes which the databases have, *.idx files, i don't know how to access them. the connection string i use is: DBFConnedction = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=dBASE IV;User...
3
5176
by: HistoricVFP | last post by:
Hello, I’ve been given the task of importing .dbf files from a very old version of Visual FoxPro (version 2.1) into Access (2003). When I import the data straight to Access it errors with: External table is not in the expected format. (Error 3274) I’ve tried the following but it did not work: “To import data from a FoxPro database, use the Microsoft Visual FoxPro ODBC driver. To do so, follow these steps: 1. Click Start, and then...
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.