@zvoni:
I know you have a better understanding about databases than I have but could it be a permission issue that the server isn't configured to grant the (this) user to perform full-text catalogs (In which case I would have expected a denied error or similar)
Hmmm....you might be right:
https://learn.microsoft.com/en-us/sql/t-sql/statements/create-fulltext-catalog-transact-sql?view=sql-server-ver16Permissions
User must have CREATE FULLTEXT CATALOG permission on the database, or be a member of the db_owner, or db_ddladmin fixed database roles.
But wouldn't explain, why it complains about a User-Transaction
Just saw it:
begin
Connection := TMSSQLConnection.Create(nil);
try
Connection.HostName := 'hostname';
Connection.DatabaseName := 'test1';
Connection.UserName := 'sa';
Connection.Password := 'password';
//Connection.Open; //missing?
Connection.ExecuteDirect('CREATE FULLTEXT CATALOG MyFullTextCatalog;', nil);
finally
Huh? Where do you open the Connection?
EDIT: Just looked at the Source of TMSSQLConnection:
There is a private Method "ExecuteDirectSQL" resp. (overloaded) "Execute" (This one needs an explicit "Open")
Use that one without an assigned Transaction.
Permissions (see above) must be correct
begin
Connection := TMSSQLConnection.Create(nil);
try
Connection.HostName := 'hostname';
Connection.DatabaseName := 'test1';
Connection.UserName := 'sa';
Connection.Password := 'password';
Connection.ExecuteDirectSQL('CREATE FULLTEXT CATALOG MyFullTextCatalog;'); //ExecuteDirectSQL calls "open" before calling "Execute"
finally
or
begin
Connection := TMSSQLConnection.Create(nil);
try
Connection.HostName := 'hostname';
Connection.DatabaseName := 'test1';
Connection.UserName := 'sa';
Connection.Password := 'password';
Connection.Open;
Connection.Execute('CREATE FULLTEXT CATALOG MyFullTextCatalog;');
finally
EDIT: Doesn't work since private *growl*
Change scope of Private to Public???
EDIT: Right.
Currently, the only way forward i see (won't mind alternative ideas) is to write a class helper, where basically you copy/paste the source code from "Execute".
Further analysis of the source-code not withstanding (calling any other private/protected methods --> "Execute" and "CheckDisConnected" e.g.)
EDIT: I think i remember having similiar issues with SQLite giving me grief when trying to execute a PRAGMA after opening the Database.
I think it was even the same Error-Message.
The Solution, too, was a Class-Helper where within i used the lowlevel calls
EDIT: Looked at it further: The lowlevel-calls require FDBProc, which is a private field, which gets assigned a Pointer-Value during Login/Connect.
Again, can only be retrieved with protected "GetHandle" *sigh*.
Damn it!!