Solved

Connect FoxPro - TDatabase

Posted on 2004-09-07
4
1,093 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 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

13 Experts available now in Live!

Get 1:1 Help Now