I have a SQLCompact database with which I am trying to access using ADO and C++ . However, due to the size of the database (300 MB, the default limit is 256 MB), I have to specify Max Database Size in the connection string. However, the .Open(...) function throws.
The code I'm using is:
HRESULT hr = conn.CreateInstance(__uuidof(Connection), NULL); conn->Open(L"Provider=Microsoft.SQLSERVER.CE.OLEDB.4.0;Data Source=test.sdf;Max Database Size=512", L"", L"",adConnectUnspecified);
Error:
HR: DB_E_ERRORSOCCURRED
Description: "The OLE DB multi-step operation generated errors. Check each OLE DB status value, if available. The job did not complete."
Message: "IDispatch Error # 3105"
Note:
I tried using the same code with a smaller database and removing Max Database Size from the connection string, and it works as expected. Adding the Max Database Size again makes the problem reappear, so my guess is that it causes an error.
Any thoughts? How can I work with databases by default Provider size?
source share