Hola a todos,
después de unas explicaciones del incombustible Neftali, me han convencido de que NO es necesario tener Microsoft Access instalado en un sistema Windows para poder crear, modificar y gestionar una base de datos MDB (que no es lo mismo que Microsoft Access, su gestor).
Me comprometí a investigarlo (incredulo que es uno, pero sin mala fe).
![Smilie](http://www.clubdelphi.com/foros/images/smilies/smile.gif)
Y adjunto el resultado por si a alguien le interesa el asunto o para referencia futura.
Formulario por aquí:
Código Delphi
[-]object Form1: TForm1
Left = 374
Top = 204
Caption = 'Form1'
ClientHeight = 141
ClientWidth = 319
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 24
Top = 16
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 0
OnClick = Button1Click
end
object SaveDialog1: TSaveDialog
Left = 160
Top = 16
end
end
Código por allá:
Código Delphi
[-]unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, comobj;
type
TForm1 = class(TForm)
Button1: TButton;
SaveDialog1: TSaveDialog;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Jet4DB: OleVariant;
begin
if SaveDialog1.Execute then
try
Jet4DB := CreateOleObject('ADOX.Catalog');
Jet4DB.Create('Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+Savedialog1.FileName+';');
Jet4DB := null;
except
on E: Exception do
ShowMessage(e.message);
end;
end;
end.
Recogido, casi en su totalidad, de Delphi3000.com:
http://www.delphi3000.com/article.asp?ID=3536
Saludos.