Subject | Re: How to bring DB online with Firebird API - 'Unrecognized service parameter bloc' |
---|---|
Author | vincent_kwinsey |
Post date | 2008-07-07T12:22:39Z |
OK - at last I managed to solve this issue, the correct code in the
last block is:
dbname:=editDBName.Text;
spb:='';
spb:=spb+char(isc_action_svc_properties);
Len:=Length(dbname);
spb:=spb+char(isc_spb_dbname)+PChar(@Len)[0]+PChar(@Len)[1]+dbname;
tmp:=isc_spb_prp_db_online;
spb:=spb+char(isc_spb_options)+PChar(@tmp)[0]+PChar(@tmp)[1]+PChar
(@tmp)[2]+PChar(@tmp)[3];
stat:=ISCServiceStart(@sv,@serviceHandle,nil,Length(spb),pchar
(spb));
This was more or less copy from IBX Administration components, e.g.:
http://www.koders.com/delphi/fid88D2F0A2709F6185853D072CED4AD14BA06BC8
2B.aspx
IBSservices.pas file - without it would be hard to figure what is
needed.
--- In firebird-support@yahoogroups.com, "vincent_kwinsey"
<vincent_kwinsey@...> wrote:
last block is:
dbname:=editDBName.Text;
spb:='';
spb:=spb+char(isc_action_svc_properties);
Len:=Length(dbname);
spb:=spb+char(isc_spb_dbname)+PChar(@Len)[0]+PChar(@Len)[1]+dbname;
tmp:=isc_spb_prp_db_online;
spb:=spb+char(isc_spb_options)+PChar(@tmp)[0]+PChar(@tmp)[1]+PChar
(@tmp)[2]+PChar(@tmp)[3];
stat:=ISCServiceStart(@sv,@serviceHandle,nil,Length(spb),pchar
(spb));
This was more or less copy from IBX Administration components, e.g.:
http://www.koders.com/delphi/fid88D2F0A2709F6185853D072CED4AD14BA06BC8
2B.aspx
IBSservices.pas file - without it would be hard to figure what is
needed.
--- In firebird-support@yahoogroups.com, "vincent_kwinsey"
<vincent_kwinsey@...> wrote:
>(spb));
> OK, I have made some progress, no the last block of code is:
>
> spb:=spb+char(isc_spb_version)+char(isc_spb_current_version);
> spb:=spb+char(isc_action_svc_properties);
> spb:=spb+char(isc_spb_dbname)+char(Length(dbname))+char(Length
> (dbname) shr 8)+dbname;
> spb:=char(isc_spb_options); //THIS SHOULD BE USED!!! - this line
> removed 'unrecognized...' error
> spb:=spb+char(isc_spb_prp_db_online);
> stat:=ISCServiceStart(@sv,@serviceHandle,nil,Length(spb),pchar
> lblStartStatusCode.Caption:=IntToStr(stat);manager',
>
> But now I have error 335544792 - 'Cannot attach to services
> although, e.g. @serviceHandle is not null, this is even morestrange,
> because the function isc_attach_service already was executedwithout
> any errors...
>