Hi,
Many years ago I wrote a small program in VB that opened a simple database in .mdb format and allowed simple searching. The purpose of this was to have a simple search without the need for Microsoft Access installed on many machines. It worked fine. I started to create a new one using Lazarus and it was working fine as well until I tried it on Windows 10 and it wont open the database.
The code I have is this (got it on the web somewhere):-
//make ODBC connection
ODBCConnection1.Driver := 'Microsoft Access Driver (*.mdb, *.accdb)';
ODBCConnection1.Params.Add('DBQ=.\id931.mdb'); // or specify full path to mdb file
ODBCConnection1.Params.Add('Locale Identifier=1031');
ODBCConnection1.Params.Add('ExtendedAnsiSQL=1');
ODBCConnection1.Params.Add('CHARSET=ansi');
ODBCConnection1.Connected := True;
ODBCConnection1.KeepConnection := True;
//transaction
SQLTransaction1.DataBase := ODBCConnection1;
SQLTransaction1.Action := caCommit;
SQLTransaction1.Active := True; //not applied to ms access(false)
SQLQuery1.DataBase := ODBCConnection1;
SQLQuery1.UsePrimaryKeyAsKey := False;
I get the following response in the error:-
......
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
Its important this program will work on any PC in our office WITHOUT the need to install any other files or passwords etc. on these machines. In Win 7 it worked fine in this way, but not in Win 10.
Can this be fixed easily?
Thanks in advance.
[update]
Also, when it compiles it seems to take 3.3GB of memory! something is clearly wrong!