1.7.0.1 Miletus MSSQLDBDriver Error

Created a Miletus Web application, dropped TMiletusMSSQLDBDriver and TMiletusClientDataSet components on the form. Configured Server, UserName, Password for the MiletusMSSQLDBDriver. Assigned the dbdriver component to the ClientDataset DBDriver property, set Active property to true. When double clicked the ClientDataSet I get the following error:
[FireDAC][Comp][Clnt]-340. Driver ID is not defined. Set TFDConnection.DriverName or add DriverID to your connection.

What course of action should I take to overcome the problem?

Hi,

At this moment we could not enable design-time support for MS SQL due to the differences between Delphi Professional and Delphi Enterprise/Architect licenses.

Please check the connection at run-time instead.

Hello,

Thank you for responding so quickly.

I assume you would implement this functionality in an upcoming version.

I ran the program but can not seem to get data from the SQL server. How do I configure MiletusMSSQLDriver properties to get data into MiletusClientDataset?

Can you provide an example source for the pas and dfm of a working program ?

Best regards.

image001.jpg

The correct settings will depend on your setup:

procedure TForm1.MiletusFormCreate(Sender: TObject);
begin
  //For example server URL or 'localhost\YOURSERVER'
  MiletusMSSQLDBDriver1.Server := 'your server'; 
  MiletusMSSQLDBDriver1.DataBase := 'your db name';
  //Set OSAuthent to true if you are on localhost and want to use Windows authentication
  MiletusMSSQLDBDriver1.OSAuthent := True;
  //If OSAuthent is False, you'll need to set UserName and Password:
  MiletusMSSQLDBDriver1.UserName := 'username';
  MiletusMSSQLDBDriver1.Password := 'password';
  //Primary key field of your table (if any)
  MiletusMSSQLDBDriver1.IndexName := 'id';
  
  MiletusClientDataSet1.DBDriver := MiletusMSSQLDBDriver1;
  //Query the contents of the table
  MiletusClientDataSet1.QueryText := 'select * from test;';

  WebDataSource1.DataSet := MiletusClientDataSet1;
  WebDBGrid1.DataSource := WebDataSource1;
end;

procedure TForm1.WebButton1Click(Sender: TObject);
begin
  //After setting to true, the WebDBGrid will be filled with your table's data.
  MiletusClientDataSet1.Active := True;
end;

Apart from setting the MiletusClientDataSet1.Active property, you can configure everything else at design-time.

Hi,

I followed the steps you described but have not been successful. I am not getting data to the grid, but I can see the component is sending the SQL commands as you can see in the attached file called “SQL profiler.png”.

What am I doing wrong ?

Best regards,

image001.jpg

Unit1.png

Running App Screen.png

Hi,

The setup you made looks OK as the connection could succeed and the query string was also sent. What does your company table structure look like? Does it contain binary or any special fields?

If there's nothing special about your table, then you can try to eliminate the issue by adding the fields one-by-one to the FieldDefs and see when it stops working.

Hi,

The company table definition is in the attached picture.

Are there limitations in the driver or the client dataset ?

Best regards.

image001.jpg

Also the collation is Turkish_ci_as for the database and Turkish_cs_as for the text fields in the company. However some fields could be database default.

Best regards.

image001.jpg

I tried the following still no data shows up;

MiletusMSSQLDBDriver1.Server := 'PC-AYDIN\SQL2017';

MiletusMSSQLDBDriver1.DataBase := 'DBI_EXWIZ_GRANISER';

MiletusMSSQLDBDriver1.OSAuthent := False;

MiletusMSSQLDBDriver1.UserName := 'DBI_EXWIZ';

MiletusMSSQLDBDriver1.Password := 'Agora';

// MiletusMSSQLDBDriver1.IndexName := 'id';

MiletusClientDataSet1.DBDriver := MiletusMSSQLDBDriver1;

MiletusClientDataSet1.QueryText := 'select * from company;';

WebDataSource1.DataSet := MiletusClientDataSet1;

WebDBGrid1.DataSource := WebDataSource1;

MiletusClientDataset1.FieldDefs.Clear;

MiletusClientDataset1.FieldDefs.Add('Company code',ftinteger,0,False);

MiletusClientDataset1.Active := true;

image001.jpg

Normally no.

This might have something to do with it. Try to assign the TMiletusClientDataSet.OnError event and see if you get any errors.

Hi,

I have found the culprit. It is the WebDBGrid that is the problem.

If I just select one field (does not matter which one) in the sql statement it returns data in 5 seconds, 2 fields 28 seconds. It keeps compounding the time it requires to populate the WebDBGrid. So no wonder I do not see anything when Select * used and 45 fields are returned.

I replaced the webdbgrid with fncgrid and it shows 5000 records in about 3 seconds.

Best regards.

image001.jpg

There was a significant TWebDBGrid speed improvement in v1.7.1.0. Are you using this latest version?

Hi Bruno,

Initially I was using 1.7.0.1 version when I tested. After I corresponding with support (on May 4) I noticed 1.7.1.0 was published. I downloaded and installed that version and restested using WebDBGrid again.

The results were not much improved from the previous version. FNCGrid is superior in speed. I wish the WebDBGrid was equally fast. You could test yourself with a simple test case yourself.

Best regards.

image001.jpg

There is a significant different between 1.7.0.0 and 1.7.1.0
Are you sure you correctly updated and that you aren't testing with cached JS files?

Retested the application with the same table and “select * from company” query. Result is :

WebDBGrid ~12.5 seconds

FncGrid ~2.5 seconds

Best regards.

image001.jpg

I can only assume you still compile against an old WEBLib.Grids.pas file

I did not have webdbgrid on the pas before I restested. I added the WebDBGrid to the form and then restested.

If there is something I should be doing in between please make a suggestion.

These are the details of the test project. If you need anything else please ask.

I would be more than happy to see webdbgrid perform as well as fncgrid.

image001.jpg

screen 2021-05-07 124952.png

dfm 2021-05-07.txt (7.93 KB)

pas 2021-05-07.txt (2.34 KB)

This doesn't give me any required information to know what is happening or to try to reproduce, such as:

  1. do you effectively compile against WEBLib.Grids.pas of v1.7.1.0?
  2. how many records are there?
  3. how many columns are there?
  1. Yes v1.7.1.0 is what is installed

image001.png

  1. 5009 records
  2. 46 columns
  3. CREATE TABLE [dbo].[Company](
  4. [Company code] [int] NOT NULL,
  5. [Company type] varchar COLLATE Turkish_CS_AS NULL,
  6. [Company name] varchar COLLATE Turkish_CS_AS NULL,
  7. [Address] varchar COLLATE Turkish_CS_AS NULL,
  8. [Address 2] varchar COLLATE Turkish_CS_AS NULL,
  9. [Country] varchar COLLATE Turkish_CS_AS NULL,
  10. [Contact name] varchar COLLATE Turkish_CS_AS NULL,
  11. [Telephone] varchar COLLATE Turkish_CS_AS NULL,
  12. [Fax] varchar COLLATE Turkish_CS_AS NULL,
  13. [Commission %] [float] NULL,
  14. [Agent bank info] [text] COLLATE Turkish_CI_AS NULL,
  15. [Distributor] [bit] NULL,
  16. [Supplier] [bit] NULL,
  17. [Owner] [int] NULL,
  18. [Cari kodu] varchar COLLATE Turkish_CS_AS NULL,
  19. [CreateDatetime] [datetime] NULL,
  20. [CreateUserid] varchar COLLATE Turkish_CS_AS NULL,
  21. [ChangeDatetime] [datetime] NULL,
  22. [ChangeUserid] varchar COLLATE Turkish_CS_AS NULL,
  23. [TAXID] varchar COLLATE Turkish_CS_AS NULL,
  24. [TAXLOC] varchar COLLATE Turkish_CS_AS NULL,
  25. [EximBank_RiskAmt] [float] NULL,
  26. [Factoring_RiskAmt] [float] NULL,
  27. [EximBank_RiskBalanceAmt] [float] NULL,
  28. [Factoring_RiskBalanceAmt] [float] NULL,
  29. [Factoring_code] [int] NULL,
  30. [CANDIDATE] [bit] NULL,
  31. [EximBank_StartDate] [datetime] NULL,
  32. [EximBank_ExpireDate] [datetime] NULL,
  33. [EximBank_currency] varchar COLLATE Turkish_CS_AS NULL,
  34. [Factoring_currency] varchar COLLATE Turkish_CI_AS NULL,
  35. [SECTOR] varchar COLLATE Turkish_CI_AS NULL,
  36. [HTTP] varchar COLLATE Turkish_CI_AS NULL,
  37. [EMAIL] varchar COLLATE Turkish_CI_AS NULL,
  38. [NOTES] [text] COLLATE Turkish_CI_AS NULL,
  39. [GROUPS] [text] COLLATE Turkish_CI_AS NULL,
  40. [Address_ZipCode] varchar COLLATE Turkish_CI_AS NULL,
  41. [FreeZone_DutyPercent] [float] NULL,
  42. [RecordActive] [smallint] NULL,
  43. [WAREHOUSE] [bit] NULL,
  44. [EORI_NBR] varchar COLLATE Turkish_CS_AS NULL,
  45. [MANUFACTURER] [bit] NULL,
  46. [Telephone2] varchar COLLATE Turkish_CI_AS NULL,
  47. [Languages] varchar COLLATE Turkish_CS_AS NULL,
  48. [Source] varchar COLLATE Turkish_CS_AS NULL,
  49. CONSTRAINT [PK_Company] PRIMARY KEY CLUSTERED
  50. (
  51. [Company code] ASC
  52. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  53. ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

image001.jpg