[fpc-pascal] Re: Connecting to Firebird using FPC/Lazarus over a LAN with user creation privilege

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sun Mar 10 15:54:23 CET 2013


Reinier Olislagers wrote:

>> But I can't do that last step from a TIBConnection. There's obviously a
>> possibility that I'm Doing It Wrong: what's the Firebird equivalent of
>> PQExec(), I'm using isc_dsql_execute_immediate()?
> Strange.
> Setting the user to borg_um, the role to RDB$ADMIN, correct password,
> the db to the newly created db, then connecting with the right
> transactions etc and doing something like TIBConnection.Execute('CREATE
> USER...') (or whatever the actual command is) should work.
> 
>> I'd very much like to be able to use SQL commands for this, since it
>> makes management and logging far easier.
> If you don't get it sorted, let me knoe & I'll try and set up a demo
> program.

I think I've got it, the correct procedure for a resultless SQL command 
is ExecuteDirect(). The reason that I'd been trying to use a different 
function was as a legacy of experimentation a year or so ago with 
Firebird events, i.e. finding how compatible I could make them with 
PostgreSQL async notifications, where if sharing a connection object 
with queries etc. one has to be careful about the handle's lifetime.

So thanks for the moral support, once I've checked over the 
documentation I should be able to press on.

As background, what I'm trying to do is set up a tree of servers and 
apps with messages passed around by journal tables and notifications. 
Only hitch is that a user has to have an initial ID before he can start 
using that type of arrangement, which I'm allocating by what is 
basically a fancy finger daemon.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list