I am trying to get the table names in a msaccess. However once executing gettablenames, I get error message of "Project raise exception class 'EDatabaseError'."
The following is my code,
procedure TForm1.FormCreate(Sender: TObject);
begin
try
with ODBCConnection1 do
begin
Connected := True;
GetTableNames(ComboBox1.Items, false);
end;
except
MessageDlg('Invalid MSAccess File!', mtError, [mbOK], 0);
end;
end;
Please help why I cannot make it work!!!