Solved

Connect FoxPro - TDatabase

Posted on 2004-09-07
4
1,108 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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