Settig SQL Server CE 'max database size'

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
jyarnot
Posts: 6
Joined: Tue 27 May 2008 15:48

Settig SQL Server CE 'max database size'

Post by jyarnot » Tue 29 Jul 2008 17:55

I am trying to set the 'max database size' attribute for a SQL Server ce database. From what I understand, this is done by passing the desired maximum size (in MB) on the connection string to the CE database. When I open the database in MS SQL Server Management Studio Express, I have an advanced option to set this and it affects all subsequent, concurrent connnections (only the first one in gets to set max size). So if I open the DB there first, then run my app, it works fine. If I don't, I hit the default limit of 256 MB. I have tried setting it as a parameter to my TSQLConnection object (params.add('max database size=2048')) but that seems to have no effect. I'm not sure if this is a TSQLConnection issue, or a driver issue or I'm just not doing it right, but since the only way I've found to connect to MS SQL CE databases is using Devart, I thought I'd start by asking here.

Here's a code snippet showing how I'm setting the attributes:

cnMain.DriverName := DriverName;
cnMain.GetDriverFunc := GetDriverFunc;
cnMain.LibraryName := LibraryName;
cnMain.VendorLib := VendorLib;
cnMain.Params.Add('max database size=2048');

cnMain is my TSQLConnection and aside from the size issue, everything works. Any help, insight or direction would be appreciated. Thanks.

jyarnot
Posts: 6
Joined: Tue 27 May 2008 15:48

Post by jyarnot » Fri 01 Aug 2008 17:32

I tried it without the TSQLConnecion. Using Data Explorer in the IDE, I clicked 'Modify Connection' and then 'Advanced' then right-click in the misc area of the Advanced Properties page and choose 'Add'. I then add a property named 'max database size' and set it to 2048 (my db is 1016 MB). After that, I can see that my connection string at the bottom of the screen now shows the value set as I'd hoped, but I still get the same error. So, now I'm thinking it's a Devart issue.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 07 Aug 2008 09:00

Now dbExpress driver for MS SQL Server does not provide feature to set the 'max database size' attribute, but we will support such functionality in the next DbxSda build.

jyarnot
Posts: 6
Joined: Tue 27 May 2008 15:48

How to access this functionality

Post by jyarnot » Tue 26 Aug 2008 17:59

I see that this is now in the latest build, but I don't see anything in the documentation that shows how to use it. My attempts at the obvious were unsuccessful.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 28 Aug 2008 13:12

To set the 'max database size' attribute for a SQL Server CE database, you should set appropriate parameter of TCRSQLConnection, like this:

Code: Select all

  TCRSQLConnection.Params.Values['Custom String'] := 'MaxDatabaseSize=2048';

Post Reply