What file is missing
What file is missing
I have an older app that uses UniDAC and it has been working fine for years. But now I would like to move it to another computer and then my problems start
The program uses MS Access database (can also use MSSQL, MySQL and SQLite) but on the new computer it won't run. It says that the database can't be found and that I know for a fact isn't the case.
If I move the files to yet another computer everything runs OK
The difference between the 2 computers is that the one where it doesn't run has no MS Office installed and the one where it runs has.
What files might I have to copy to the failing computer to get it running?
(Unfortunately I have no access to the source files for this program and I have no contact with the guy who made it)
The program uses MS Access database (can also use MSSQL, MySQL and SQLite) but on the new computer it won't run. It says that the database can't be found and that I know for a fact isn't the case.
If I move the files to yet another computer everything runs OK
The difference between the 2 computers is that the one where it doesn't run has no MS Office installed and the one where it runs has.
What files might I have to copy to the failing computer to get it running?
(Unfortunately I have no access to the source files for this program and I have no contact with the guy who made it)
Re: What file is missing
PS: I tried installing MS Office on the failing computer and then the program works. But I want it to run without Office installed as I have no more licenses for it so I can only install a demo.
Re: What file is missing
Hello,
To work with a MS Access database on, an ODBC driver is required to be installed on the PC - Microsoft Access Driver. It is available for download on the Microsoft website.
To work with a MS Access database on, an ODBC driver is required to be installed on the PC - Microsoft Access Driver. It is available for download on the Microsoft website.
Re: What file is missing
Have you got a name of that driver?
There is none to be found on Microsoft.com as far as I can se and MDAC is not and option on Windows 7
There is none to be found on Microsoft.com as far as I can se and MDAC is not and option on Windows 7
Re: What file is missing
To work with MS Access, UniDAC uses the standard ODBC driver - Microsoft Access Driver.
Re: What file is missing
That might be so but it doesn't not work until I installed the AccessDatabaseEngine I found after long time search on the web
Re: What file is missing
Please make sure this driver is not installed on your PC any more. The list of drivers is available in ODBC Data Source Administrator (C:\Windows\SysWOW64\odbcad32.exe - 32-bit drivers, C:\Windows\System32\odbcad32.exe - 64-bit drivers). The same driver of different bitness can't be installed simultaneously.
Re: What file is missing
It doesn't help to add the ODBC driver using ODBC Data Source Administrator (it is a 32 bit Windows 7 DK) but installing the databaseengine helped so I don't know what to say.
Re: What file is missing
This ODBC driver (Microsoft Access Driver) is usually installed with Windows automatically. Please specify the exact version of the installed driver (you can learn it from ODBC Data Source Administrator).
Re: What file is missing
There is a screenshot of the driverversion in my Dropbox
https://dl.dropboxusercontent.com/u/65392149/driver.png
https://dl.dropboxusercontent.com/u/65392149/driver.png
Re: What file is missing
We can't reproduce the problem on the same version of the driver. The problem may be due to a particular PC. Please try to reproduce the case using the standard components (for example, BDE), and let us know the result.
Re: What file is missing
What I have done now is creating a very basic ADO sample https://dl.dropboxusercontent.com/u/653 ... DOtest.zip and tried that on a complete new Windows 7 installation with all available updates - and it runs as it is supposed to
When I take my program that uses UniDac it doesn't run on the same computer
When I take my program that uses UniDac it doesn't run on the same computer
Re: What file is missing
Microsoft.Jet.OLEDB.4.0 driver is used in your project. UniDAC uses ODBC driver. Replace the provider with Microsoft OLE DB Provider for ODBC Drivers (MSDASQL.1), select a configured DSN and try to reconnect.
Re: What file is missing
I am not quite sure what you suggest here.
As I said earlier I have no access to the source of this program
I am quite sure the programmer has used the same method as I have been using for MS Access all the time I worked with UniDAC in my previous job as it was his datamodule I used.
I found the source for that in an old backup and pasted it below.
But if I can't get it to work with the MS Access file, I will just keep on using a SQLite file as that works OK on the new computer
unit F_UniConn;
interface
uses
{$Include UniDACCommon.inc}
Db, MemDS, DbAccess, Uni, DAScript, UniScript,
Classes, Forms, MemData, SysUtils, Windows;
type
TfrmUniConn = Class(TDataModule)
UniServer: TUniConnection;
UniScript: TUniScript;
procedure DataModuleDestroy(Sender: TObject);
procedure UniServerConnectionLost(Sender : TObject; Component : TComponent;
ConnLostCause : TConnLostCause; var RetryMode : TRetryMode);
procedure UniScriptError(Sender: TObject; E: Exception; SQL: string; var Action: TErrorAction);
procedure UniScriptBeforeExecute(Sender: TObject; var SQL: string; var Omit: Boolean);
private
fResult: integer;
published
function CreateQuery: TUniQuery;
public
property Result: integer read fResult write fResult;
constructor Create(aOwner: TComponent); reintroduce;
end;
var
frmUniConn: TfrmUniConn;
implementation
uses
U_Logfile,
U_DbList, U_Settings;
{$R *.dfm}
constructor TfrmUniConn.Create(aOwner: TComponent);
begin
inherited Create(aOwner);
try
UniServer.ProviderName := DbList.Items[Settings.Database.Provider].ProviderName;
UniServer.Server := Settings.Database.Host;
UniServer.Database := Settings.Database.Name;
UniServer.LoginPrompt := False;
UniServer.Options.LocalFailover := True;
case Settings.Database.Provider of
dbMySQL :
begin
UniServer.Port := Settings.Database.Port;
UniServer.Username := Settings.Database.UserName;
UniServer.Password := Settings.Database.UserPass;
UniServer.SpecificOptions.Values['UseUnicode'] := 'True';
end;
dbMSSQL :
begin
UniServer.Port := Settings.Database.Port;
UniServer.Username := Settings.Database.UserName;
UniServer.Password := Settings.Database.UserPass;
UniServer.SpecificOptions.Values['ApplicationName'] := Application.Name;
UniServer.SpecificOptions.Values['OLEDbProvider'] := 'prSQL';
UniServer.SpecificOptions.Values['ConnectionTimeout'] := '100';
// UniServer.SpecificOptions.Values['MultipleActiveResultSets'] := 'True';
// UniServer.SpecificOptions.Values['Provider'] := 'prNativeClient';
// UniServer.SpecificOptions.Values['Authentication'] := 'AuWindows'
// UniServer.SpecificOptions.Values['Authentication'] := 'AuServer'
end;
dbSQLite :
begin
UniServer.Username := '';
UniServer.Password := '';
UniServer.SpecificOptions.Values['UseUnicode'] := 'True';
// UniServer.SpecificOptions.Values['SQLite.ClientLibrary'] := ExtractFilePath(Paramstr(0)) + 'sqlite3.dll';
end;
dbMSAccess :
begin
UniServer.Username := '';
UniServer.Password := '';
UniServer.SpecificOptions.Values['UseUnicode'] := 'True';
UniServer.SpecificOptions.Values['ExtendedAnsiSQL'] := 'True';
end;
end;
UniServer.Connect;
except on E:Exception do
Logfile.Database.Error('F_UniConn.Create: ' + E.Message);
end;
end;
function TfrmUniConn.CreateQuery: TUniQuery;
begin
try
Result := TUniQuery.Create(nil);
Result.Options.LongStrings := True;
Result.Connection := UniServer;
except
on E: exception do
begin
Logfile.Error('F_UniConn.CreateQuery: ' + E.Message);
Result := nil;
end
end;
end;
procedure TfrmUniConn.DataModuleDestroy(Sender: TObject);
begin
UniServer.Disconnect;
end;
procedure TfrmUniConn.UniScriptBeforeExecute(Sender: TObject; var SQL: string; var Omit: Boolean);
begin
Result := 0;
end;
procedure TfrmUniConn.UniScriptError(Sender: TObject; E: Exception; SQL: string; var Action: TErrorAction);
begin
Action := eaContinue;
Result := EDAError(E).ErrorCode;
Logfile.Database.Error('Server error: ' + IntToStr(EDAError(E).ErrorCode) + ' - ' + E.Message);
Logfile.Database.Event(uniScript.SQL.Text);
end;
procedure TfrmUniConn.UniServerConnectionLost(Sender: TObject;
Component: TComponent; ConnLostCause: TConnLostCause;
var RetryMode: TRetryMode);
begin
RetryMode := rmReconnectExecute;
end;
end.
As I said earlier I have no access to the source of this program
I am quite sure the programmer has used the same method as I have been using for MS Access all the time I worked with UniDAC in my previous job as it was his datamodule I used.
I found the source for that in an old backup and pasted it below.
But if I can't get it to work with the MS Access file, I will just keep on using a SQLite file as that works OK on the new computer
unit F_UniConn;
interface
uses
{$Include UniDACCommon.inc}
Db, MemDS, DbAccess, Uni, DAScript, UniScript,
Classes, Forms, MemData, SysUtils, Windows;
type
TfrmUniConn = Class(TDataModule)
UniServer: TUniConnection;
UniScript: TUniScript;
procedure DataModuleDestroy(Sender: TObject);
procedure UniServerConnectionLost(Sender : TObject; Component : TComponent;
ConnLostCause : TConnLostCause; var RetryMode : TRetryMode);
procedure UniScriptError(Sender: TObject; E: Exception; SQL: string; var Action: TErrorAction);
procedure UniScriptBeforeExecute(Sender: TObject; var SQL: string; var Omit: Boolean);
private
fResult: integer;
published
function CreateQuery: TUniQuery;
public
property Result: integer read fResult write fResult;
constructor Create(aOwner: TComponent); reintroduce;
end;
var
frmUniConn: TfrmUniConn;
implementation
uses
U_Logfile,
U_DbList, U_Settings;
{$R *.dfm}
constructor TfrmUniConn.Create(aOwner: TComponent);
begin
inherited Create(aOwner);
try
UniServer.ProviderName := DbList.Items[Settings.Database.Provider].ProviderName;
UniServer.Server := Settings.Database.Host;
UniServer.Database := Settings.Database.Name;
UniServer.LoginPrompt := False;
UniServer.Options.LocalFailover := True;
case Settings.Database.Provider of
dbMySQL :
begin
UniServer.Port := Settings.Database.Port;
UniServer.Username := Settings.Database.UserName;
UniServer.Password := Settings.Database.UserPass;
UniServer.SpecificOptions.Values['UseUnicode'] := 'True';
end;
dbMSSQL :
begin
UniServer.Port := Settings.Database.Port;
UniServer.Username := Settings.Database.UserName;
UniServer.Password := Settings.Database.UserPass;
UniServer.SpecificOptions.Values['ApplicationName'] := Application.Name;
UniServer.SpecificOptions.Values['OLEDbProvider'] := 'prSQL';
UniServer.SpecificOptions.Values['ConnectionTimeout'] := '100';
// UniServer.SpecificOptions.Values['MultipleActiveResultSets'] := 'True';
// UniServer.SpecificOptions.Values['Provider'] := 'prNativeClient';
// UniServer.SpecificOptions.Values['Authentication'] := 'AuWindows'
// UniServer.SpecificOptions.Values['Authentication'] := 'AuServer'
end;
dbSQLite :
begin
UniServer.Username := '';
UniServer.Password := '';
UniServer.SpecificOptions.Values['UseUnicode'] := 'True';
// UniServer.SpecificOptions.Values['SQLite.ClientLibrary'] := ExtractFilePath(Paramstr(0)) + 'sqlite3.dll';
end;
dbMSAccess :
begin
UniServer.Username := '';
UniServer.Password := '';
UniServer.SpecificOptions.Values['UseUnicode'] := 'True';
UniServer.SpecificOptions.Values['ExtendedAnsiSQL'] := 'True';
end;
end;
UniServer.Connect;
except on E:Exception do
Logfile.Database.Error('F_UniConn.Create: ' + E.Message);
end;
end;
function TfrmUniConn.CreateQuery: TUniQuery;
begin
try
Result := TUniQuery.Create(nil);
Result.Options.LongStrings := True;
Result.Connection := UniServer;
except
on E: exception do
begin
Logfile.Error('F_UniConn.CreateQuery: ' + E.Message);
Result := nil;
end
end;
end;
procedure TfrmUniConn.DataModuleDestroy(Sender: TObject);
begin
UniServer.Disconnect;
end;
procedure TfrmUniConn.UniScriptBeforeExecute(Sender: TObject; var SQL: string; var Omit: Boolean);
begin
Result := 0;
end;
procedure TfrmUniConn.UniScriptError(Sender: TObject; E: Exception; SQL: string; var Action: TErrorAction);
begin
Action := eaContinue;
Result := EDAError(E).ErrorCode;
Logfile.Database.Error('Server error: ' + IntToStr(EDAError(E).ErrorCode) + ' - ' + E.Message);
Logfile.Database.Event(uniScript.SQL.Text);
end;
procedure TfrmUniConn.UniServerConnectionLost(Sender: TObject;
Component: TComponent; ConnLostCause: TConnLostCause;
var RetryMode: TRetryMode);
begin
RetryMode := rmReconnectExecute;
end;
end.
Re: What file is missing
We can't reproduce the problem. If you can give us access to the "problem" machine (for example, using TeamViewer), we can check this behavior on a particular PC.