Solved

Connect FoxPro - TDatabase

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

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…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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