Solved

Connect FoxPro - TDatabase

Posted on 2004-09-07
4
1,098 Views
Last Modified: 2008-01-09
Connect FoxPro - TDatabase

How to connect ODBC - FoxPro database driver with TDatabase component which reads and writes index (*.idx) files ?

Thanks.
0
Comment
Question by:vbmn
  • 2
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 500 total points
ID: 11994985
usual you could use the dbase-bde driver for foxpro
(its just a level (property) adjustment in the bde-admin tool to do),
but i don't know, if an idx will be touched

meikl ;-)
0
 
LVL 2

Author Comment

by:vbmn
ID: 11995121
Well, I read on site :

http://community.borland.com/article/print/0%2C1772%2C19657%2C00.html

//Question:
//
//Does the BDE support FoxPro IDX files?
//
//Answer:
//
//The BDE supports FoxPro tables via its native driver up to version 2.6. IDX files
//were added in a FoxPro version after 2.6. Because of this the native driver
//does not support IDX files. If you have ODBC driver which can be configured
//to open IDX files whenever a table is opened then this would be a viable alternative.

Where to find "ODBC driver which can be configured to open IDX files" ?

And How to configure TDATABASE PARAMS to connect TDATABASE for it ?

Thanks.
0
 
LVL 2

Author Comment

by:vbmn
ID: 11995501
And I found :

http://msdn.microsoft.com/vfoxpro/downloads/updates/odbc/default.aspx

Visual FoxPro ODBC Driver
After install I tried to set it with TDatabase PARAMS :

/////////////

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DB, DBTables;

type
  TForm1 = class(TForm)
    Database1: TDatabase;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Database1.Connected:=False;
Database1.DatabaseName:='VisualFoxPro';
Database1.Params.Clear;
Database1.Params.Add('DATABASE NAME=C:\');
Database1.Params.Add('USER NAME=');
Database1.Params.Add('ODBC DSN=Visual FoxPro Database');
Database1.Params.Add('OPEN MODE=READ/WRITE');
Database1.Params.Add('SCHEMA CACHE SIZE=8');
Database1.Params.Add('SQLQRYMODE=');
Database1.Params.Add('LANGDRIVER=');
Database1.Params.Add('SQLPASSTHRU MODE=SHARED AUTOCOMMIT');
Database1.Params.Add('SCHEMA CACHE TIME=-1');
Database1.Params.Add('MAX ROWS=-1');
Database1.Params.Add('BATCH COUNT=200');
Database1.Params.Add('ENABLE SCHEMA CACHE=FALSE');
Database1.Params.Add('SCHEMA CACHE DIR=');
Database1.Params.Add('ENABLE BCD=FALSE');
Database1.Params.Add('ROWSET SIZE=20');
Database1.Params.Add('BLOBS TO CACHE=64');
Database1.Params.Add('PASSWORD=');
Database1.DriverName:='Microsoft Visual FoxPro Driver';
Database1.Connected:=True;
end;

end.

/////////////

There was an error :
EDBEngineError :
'General SQL Error,
[Microsoft][ODBC Visual FoxPro Driver]DATABASE
[Microsoft][ODBC Visual FoxPro Driver]SourceDB
Alias: VisualFoxPro'
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 12003551
hmm,
i have no foxpro nor this odbc-driver,
so i run out of tips. maybe this odbc-driver must be configured frist
with the odbc-admin and then bind this configuration into the bde

just a guess, sorry

meikl ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now