Hello Devart, I have just started to use UniDAC to connect to the Microsoft Access database. Because of the lack of available examples, I am not clear why this exception is always thrown every time I execute a query: [Microsoft] [ODBC Microsoft Access Driver] optional 'S function is not implemented.
This is the code for the database connection:
----------------------------------------------------------------------
procedure TForm1.AccessConnection(DBFileName, AuthMode, DBPassword: string);
begin
if AccessConn = nil then
AccessConn := TUniConnection.Create(nil);
with AccessConn do
begin
ProviderName := 'Access';
Database := DBFileName;
SpecificOptions.Values['ColumnWiseBinding'] := 'False';
SpecificOptions.Values['ConnectionTimeout'] := '10';
SpecificOptions.Values['ExclusiveLock'] := 'False';
SpecificOptions.Values['ExtendedAnsiSQL'] := 'True';
SpecificOptions.Values['ForceCreateDatabase'] := 'False';
if StrToInt(AuthMode) = 1 then
begin
Username := 'Admin';
Password := DBPassword;
end;
end;
end;
----------------------------------------------------------------------
This is the code for the database query:
----------------------------------------------------------------------
procedure TForm1.btn2Click(Sender: TObject);
const
QuerySQL = 'SELECT Name FROM MSysObjects WHERE Type = 1 AND Flags = 0';
var
QueryTables: TUniQuery;
begin
QueryTables := TUniQuery.Create(nil);
try
QueryTables.Connection := AccessConn;
try
with QueryTables do
begin
SQL.Add(QuerySQL);
Open;
end;
if QueryTables.RecordCount > 0 then
begin
QueryTables.First;
while not QueryTables.Eof do
begin
mmo1.Lines.Append(QueryTables.Fields[0].AsString);
QueryTables.Next;
end;
end;
except
on Ex: Exception do
begin
mmo1.Lines.Append(Ex.ClassName + ': ' + Ex.Message);
end;
end;
finally
QueryTables.Free;
end;
end;
----------------------------------------------------------------------
Can you give me some suggestions?
By the way, this is my development environment: Windows 7 + Delphi 7,I am using Access 2016.
[Microsoft] [ODBC Microsoft Access Driver] The optional function is not implemented
-
- Posts: 16
- Joined: Fri 13 Dec 2019 16:39
Re: [Microsoft] [ODBC Microsoft Access Driver] The optional function is not implemented
Thank you for the information. We have already fixed that issue, the fix will be included in upcoming version of our product which will be released in a few days. Please follow the news on our website.