Link to home
Start Free TrialLog in
Avatar of philly_tee
philly_teeFlag for New Zealand

asked on

Delphi and MDB's

Hi,

I have reached a point in programming where I am thoroughly annoyed with the BDE and paradox.
I know you can use MDB files instead, and SQL.

Could somebody please point me in the direction of tutorials or show me how to configure delphi to use MDB files and perform queries using sql instead of tables?

TIA

Philip
ASKER CERTIFIED SOLUTION
Avatar of mokule
mokule
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
procedure TForm1.FormCreate(Sender: TObject);
var
  FN:     TFileName;
  ConnStr:string;
begin
  FN := ExtractFilePath(Application.ExeName) + 'FRIENDS.MDB';
  ConnStr := 'Data Source=' + FN + ';Provider=Microsoft.Jet.OLEDB.4.0';
  if FileExists(FN) then
  begin
    ADOConnection.ConnectionString := ConnStr;
    ADOConnection.Open;
    ADOQueryLIST.Connection := AdoConnection;
    ADOQueryLIST.Active := True;
    ADOQueryLIST.FieldByName('ID').Visible := False;
    ADOQueryLIST.FieldByName('INFO').Visible := False;
    ADOQueryLIST.FieldByName('COUNTRY').Visible := False;
  end;
end;

procedure TForm1.FormDestroy(Sender: TObject);
var
  I:      Integer;
begin
  for I := 0 to ADOConnection.DataSetCount-1 do
    ADOConnection.DataSets[I].Active := False;
end;
Avatar of mhamini
mhamini

hi friend ...
I provide an Article about accessing MDB files from Delphi and ... a FreeWare Good Componenet for managing MDB and other database types , directly from Borland Delphi!! ...
I upload all that usefull information such as that article and that component here :
+) www.mizan3.com/delphi/DelphiMDB.zip
download info and enjoy ... :)

Regards. (Dont Forget Accepting if this Package was usefull ... :) )
Why do you want to suffer using Access? It's slow, unreliable, non standard, heavy, stupid and much, much, much annoying under many circumstances. It also helps in messing things up because it allows you to use SQL keywords as table/fields names, a
practice highly discouraged for obvious reasons.

Dates are nonstandard too(# char delimiter) and it's DARN slow when you get a fair amount of data in an MDB.
It's also easy corruptible and works very badly in a crowded net environment if you have more of 2 or 3 people
accessing the DB concurrently. There's no concept like "locking" and "concurrent access" and if you want to
compact it, then good luck! It also generates additional files and sometimes they don't get deleted, so you
have to delete them yourself otherwise the applicaton won't work anymore.

Access is better than Paradox in the POV that the former takes Paradox problems on the next level, but doesn't solve them.

There're so many alternatives to it such as MSDE or Firebird(nope, MySQL imho isn't an alternative...).

Cheers,

Andrew
SOLUTION
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of philly_tee

ASKER

Thanks for that - Points allocated evenly between the three posts which I found helped me.

mnasman - thannks for the tip, I'm investigating nexusdb right now.

Philip