Page 1 of 1

OleDB Alpha testers thread!

Posted: 01.01.2015, 20:46
by EgonHugeist
Hello Zeos-comunity!

since new year 2015 i added a new Driver "OleDB"-Alfa-Version. This will be the topic thread for first testers to share first experiences.

To be clear:
The new driver simply is a native access driver for all Ole-Drivers. In addition Microsoft declared the OleDB as deprecated(year 2014) but OleDB was first choise until MS-SQL Server 2012. This driver bypasses the known "ADO" bridge!

Current performance tests are amazing! This new driver is imbelievable faster then ADO or the TDS protocol.
To get connected: use it like ADO. For the TZConnection users: click the button on the Database property editor and the "known" OleDB connection-string builder dialog will open.

known issues until 31.12.2014:
-a IZCallableStatement is missing -> TZStoredProcedure is not supported yet! So let's fix it.
-weired issues with more than one Connection and different TransactionIsolationLevels.. Did i overlook something? Feel free to help!
Edit: The MSOLEDB-Provider is cloning the Connections silently in background. Something i miss here. but i can find it yet.

Second Edit: fast lob reading is introduced. It depends on chunked reads. Increase 'Chunk_size=x' in bytes(defult 4KB/chunk) for faster reading!

Stay tuned! Happy new Year! Please help!
Feel free to attach performance results!

Re: OleDB Alpha testers thread!

Posted: 08.01.2015, 00:44
by Alfa000
Hello. In metod TZOleDBResultSet.GetString(ColumnIndex: Integer) you have missing this line:

Code: Select all

begin
   Result := ''; //This line is missing in r3591
   if not (IsNull(ColumnIndex)) then
   begin
      ...
      ...
   end;
end;


If returned field is null, then result is undefined!

Same problem is in some next methods (and maybe more):
TZOleDBResultSet.GetAnsiString
TZOleDBResultSet.GetUTF8String
TZOleDBResultSet.GetRawByteString

Re: OleDB Alpha testers thread!

Posted: 08.01.2015, 08:07
by EgonHugeist
Done! R3592 /testing-7.2

You are right the values haven't been initialized if Result is NULL.
Thanks for the feedback

Re: OleDB Alpha testers thread!

Posted: 08.01.2015, 16:47
by Alfa000
I can't download last SVN revision because is not available on the sf.net today. Bu i found next issue.

Code: Select all

var
  u: TZURL;
  con: IZConnection;
  stat: IZStatement;
  RS: IZResultSet;
  SQL: string;
begin
  u := TZURL.Create;
  u.Protocol := 'OleDB';
  u.Database := 'Provider=SQLNCLI11.1;Trusted_Connection=yes;Encrypt=yes;Persist Security Info=True;Server=...';

  con :=  DriverManager.GetConnection(u.URL);

  stat := con.CreateStatement;
  SQL :=
    'CREATE TABLE "Test" ('+
     '"Id" INT IDENTITY(1,1) PRIMARY KEY,'+
    '"Int_value" INT NOT NULL)';
  stat.Execute(SQL);
  SQL :=
    'INSERT INTO "Test" ("Int_value") VALUES (10)';
  stat.Execute(SQL);
  SQL :=
    'SELECT'+
      '"ID", '+
      '"Int_value" '+
    'FROM Test';
  RS := stat.ExecuteQuery(SQL);
  Assert(Assigned(RS));
  Assert(RS.Next);
  Assert(RS.GetInt(2)=10);
  SQL :=
    'SELECT'+
      '"ID", '+
      '"Int_value", '+
      '"Some_mistake_fild_name" '+ //purpose mistake for testing case
    'FROM Test';
  RS := stat.ExecuteQuery(SQL);
  Assert(Assigned(RS)); ----> this assertions fails!
  Assert(RS.Next);


If i execute select with non existing field, no error occours, no info is returned, but resulset is not assigned too of course.

Re: OleDB Alpha testers thread!

Posted: 15.01.2015, 22:39
by EgonHugeist
Had no time for OleDB last days. Hope i can check it @weekend..

Re: OleDB Alpha testers thread!

Posted: 09.02.2016, 05:48
by EgonHugeist
Hi,

inbetween the issue should have been resolved. As i wrote Ole doesn't return the lob-attribute for the column, just a imbelievable huge col-size.
However i can use the VARxxxx(MAX) fields now. Same on ODBC