-
Notifications
You must be signed in to change notification settings - Fork 58
/
IB_Intf.pas
2160 lines (1939 loc) · 76.3 KB
/
IB_Intf.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{***************************************************************}
{ FIBPlus - component library for direct access to Firebird and }
{ InterBase databases }
{ }
{ FIBPlus is based in part on the product }
{ Free IB Components, written by Gregory H. Deatz for }
{ Hoagland, Longo, Moran, Dunst & Doukas Company. }
{ mailto:[email protected] }
{ }
{ Copyright (c) 1998-2007 Devrace Ltd. }
{ Written by Serge Buzadzhy ([email protected]) }
{ }
{ ------------------------------------------------------------- }
{ FIBPlus home page: http://www.fibplus.com/ }
{ FIBPlus support : http://www.devrace.com/support/ }
{ ------------------------------------------------------------- }
{ }
{ Please see the file License.txt for full license information }
{***************************************************************}
unit IB_Intf;
interface
uses
{$I FIBPlus.inc}
{$T-}
{$IFDEF WINDOWS} Windows , {$ENDIF}
SyncObjs, Classes,Sysutils, ibase, IB_InstallHeader, IB_Externals,FIBPlatforms;
type
{$M-}
IIBClientLibrary = interface
['{BB362CBF-2BD0-41A8-8982-F5E3327354A6}']
function GetLibName:string;
function GetIBClientVersion: Integer;
function GetIBClientMinorVersion: Integer;
function GetBusy:boolean;
function isc_attach_database(status_vector : PISC_STATUS; db_name_length : Short;
db_name : PAnsiChar; db_handle : PISC_DB_HANDLE;
parm_buffer_length : Short; parm_buffer : PAnsiChar): ISC_STATUS;
function isc_array_get_slice(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
trans_handle : PISC_TR_HANDLE; array_id : PISC_QUAD;
descriptor : PISC_ARRAY_DESC; dest_array : PVoid;
slice_length : ISC_LONG): ISC_STATUS;
function isc_array_lookup_bounds(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
trans_handle : PISC_TR_HANDLE; table_name, column_name : PAnsiChar;
descriptor : PISC_ARRAY_DESC): ISC_STATUS;
function isc_array_lookup_desc(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
trans_handle : PISC_TR_HANDLE; table_name, column_name : PAnsiChar;
descriptor : PISC_ARRAY_DESC): ISC_STATUS;
function isc_array_set_desc(status_vector : PISC_STATUS; table_name : PAnsiChar;
column_name : PAnsiChar; sql_dtype, sql_length, sql_dimensions : PShort;
descriptor : PISC_ARRAY_DESC): ISC_STATUS;
function isc_array_put_slice(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
trans_handle : PISC_TR_HANDLE; array_id : PISC_QUAD;
descriptor : PISC_ARRAY_DESC; source_array : PVoid;
slice_length : PISC_LONG): ISC_STATUS;
function isc_blob_info(status_vector : PISC_STATUS; blob_handle : PISC_BLOB_HANDLE;
item_list_buffer_length : Short; item_list_buffer : PAnsiChar;
result_buffer_length : Short; result_buffer : PAnsiChar): ISC_STATUS;
function isc_blob_lookup_desc(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
trans_handle : PISC_TR_HANDLE; table_name, column_name : PAnsiChar;
descriptor : PISC_BLOB_DESC; global : PUChar): ISC_STATUS;
function isc_blob_set_desc(status_vector : PISC_STATUS; table_name, column_name : PAnsiChar;
subtype, charset, segment_size : Short; descriptor : PISC_BLOB_DESC): ISC_STATUS;
function isc_cancel_blob(status_vector : PISC_STATUS; blob_handle : PISC_BLOB_HANDLE): ISC_STATUS;
function isc_cancel_events(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
event_id : PISC_LONG): ISC_STATUS;
function isc_que_events(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
event_id : PISC_LONG; length : Short; event_buffer : PAnsiChar;
event_function : TISC_CALLBACK; event_function_arg : PVoid): ISC_STATUS;
function isc_wait_for_event (status_vector : PISC_STATUS;
db_handle : PISC_DB_HANDLE;
length : Short;
event_buffer,result_buffer : PAnsiChar): ISC_STATUS;
function isc_close_blob(status_vector : PISC_STATUS; blob_handle : PISC_BLOB_HANDLE): ISC_STATUS;
function isc_create_blob2(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
tran_handle : PISC_TR_HANDLE; blob_handle : PISC_BLOB_HANDLE;
blob_id : PISC_QUAD; bpb_length : Short; bpb_address : PAnsiChar): ISC_STATUS;
function isc_commit_retaining(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE): ISC_STATUS;
function isc_commit_transaction(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE): ISC_STATUS;
function isc_transaction_info(status_vector : PISC_STATUS;
tran_handle : PISC_TR_HANDLE;
item_list_buffer_length : Short;
item_list_buffer : PAnsiChar;
result_buffer_length : Short;
result_buffer : PAnsiChar): ISC_STATUS;
function isc_database_info(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
item_list_buffer_length : Short; item_list_buffer : PAnsiChar;
result_buffer_length : Short; result_buffer : PAnsiChar): ISC_STATUS;
procedure isc_decode_date(ib_date: PISC_QUAD; tm_date: PCTimeStructure);
procedure isc_decode_sql_date(ib_date: PISC_DATE; tm_date: PCTimeStructure);
procedure isc_decode_sql_time(ib_time: PISC_TIME; tm_date: PCTimeStructure);
procedure isc_decode_timestamp(ib_timestamp: PISC_TIMESTAMP; tm_date: PCTimeStructure);
function isc_detach_database(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE): ISC_STATUS;
function isc_drop_database(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE): ISC_STATUS;
function isc_dsql_alloc_statement2(const status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
stmt_handle : PISC_STMT_HANDLE): ISC_STATUS;
function isc_dsql_describe(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
dialect : UShort; xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_describe_bind(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
dialect : UShort; xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_execute(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
stmt_handle : PISC_STMT_HANDLE; dialect : UShort;
xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_execute2(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
stmt_handle : PISC_STMT_HANDLE; dialect : UShort;
in_xsqlda, out_xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_execute_immediate(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
tran_handle : PISC_TR_HANDLE; length : UShort;
statement : PAnsiChar; dialect : UShort;
xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_exec_immed2(status_vector : PISC_STATUS;
db_handle : PISC_DB_HANDLE;
tran_handle : PISC_TR_HANDLE;
length : UShort;
statement : PAnsiChar;
dialect : UShort;
in_xsqlda,
out_xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_fetch(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
dialect : UShort; xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_free_statement(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
options : UShort): ISC_STATUS;
function isc_dsql_prepare(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
stmt_handle : PISC_STMT_HANDLE; length : UShort;
statement : PAnsiChar; dialect : UShort;
xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_set_cursor_name(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
cursor_name : PAnsiChar; _type : UShort): ISC_STATUS;
function isc_dsql_sql_info(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
item_length : Short; items : PAnsiChar; buffer_length : Short;
buffer : PAnsiChar): ISC_STATUS;
procedure isc_encode_date(tm_date : PCTimeStructure; ib_date : PISC_QUAD);
procedure isc_encode_sql_date(tm_date: PCTimeStructure; ib_date : PISC_DATE);
procedure isc_encode_sql_time(tm_date : PCTimeStructure; ib_time : PISC_TIME);
procedure isc_encode_timestamp(tm_date : PCTimeStructure; ib_timestamp : PISC_TIMESTAMP);
function isc_event_block(event_buffer : PPAnsiChar; result_buffer : PPAnsiChar;
id_count : UShort; event_list : array of PAnsiChar): ISC_LONG;
procedure isc_event_counts(status_vector : PISC_STATUS; buffer_length : Short;
event_buffer : PAnsiChar; result_buffer : PAnsiChar);
function isc_free(isc_arg1 : PAnsiChar): ISC_LONG;
function isc_get_segment(status_vector : PISC_STATUS; blob_handle : PISC_BLOB_HANDLE;
actual_seg_length : PUShort; seg_buffer_length : UShort;
seg_buffer : PAnsiChar): ISC_STATUS;
function isc_put_segment(status_vector : PISC_STATUS; blob_handle : PISC_BLOB_HANDLE;
seg_buffer_len : UShort; seg_buffer : PAnsiChar): ISC_STATUS;
function isc_interprete(buffer : PAnsiChar; status_vector : PPISC_STATUS): ISC_STATUS;
function fb_Interpret(buffer: PAnsiChar; BufLen: ULong;
status_vector : PPISC_STATUS):ISC_STATUS;
function isc_open_blob2(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
tran_handle : PISC_TR_HANDLE; blob_handle : PISC_BLOB_HANDLE;
blob_id : PISC_QUAD; bpb_length : Short; bpb_buffer : PAnsiChar): ISC_STATUS;
function isc_prepare_transaction2(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
msg_length : Short; msg : PAnsiChar): ISC_STATUS;
function isc_rollback_retaining(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE): ISC_STATUS;
function isc_rollback_transaction(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE): ISC_STATUS;
function isc_start_multiple(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
db_handle_count : Short; teb_vector_address : PISC_TEB): ISC_STATUS;
function isc_sqlcode(status_vector : PISC_STATUS): ISC_LONG;
procedure isc_sql_interprete(sqlcode : Short; buffer : PAnsiChar;
buffer_length : Short);
function isc_vax_integer(buffer : PAnsiChar; length : Short): ISC_LONG;
function isc_add_user(status_vector : PISC_STATUS; user_sec_data : PUserSecData): ISC_STATUS;
function isc_delete_user(status_vector : PISC_STATUS; user_sec_data : PUserSecData): ISC_STATUS;
function isc_modify_user(status_vector : PISC_STATUS; user_sec_data : PUserSecData): ISC_STATUS;
function isc_prepare_transaction(status_vector : PISC_STATUS;
tran_handle : PISC_TR_HANDLE): ISC_STATUS;
function BLOB_put(isc_arg1 : Ansichar; isc_arg2 : PBSTREAM): Int;
function BLOB_get(isc_arg1 : PBSTREAM): Int;
//IB2007
function isc_dsql_batch_execute_immed(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
tran_handle : PISC_TR_HANDLE; Dialect : UShort; no_of_sql : ulong;
statement : PPAnsiChar; rows_affected : PULong) : ISC_STATUS;
function isc_dsql_batch_execute(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
stmt_handle : PISC_STMT_HANDLE; Dialect : UShort;
insqlda : PXSQLDA; no_of_rows : UShort;
batch_vars : PPXSQLVAR; rows_affected : PULong) : ISC_STATUS;
//FB2.5
function fb_cancel_operation(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
option : UShort
) : ISC_STATUS;
function fb_sqlstate(user_status: PISC_STATUS):FIBByteString;
// Service manager functions
function isc_service_attach (status_vector : PISC_STATUS;
isc_arg2 : UShort;
isc_arg3 : PAnsiChar;
service_handle : PISC_SVC_HANDLE;
isc_arg5 : UShort;
isc_arg6 : PAnsiChar): ISC_STATUS;
function isc_service_detach(status_vector : PISC_STATUS;
service_handle : PISC_SVC_HANDLE): ISC_STATUS;
function isc_service_query (status_vector : PISC_STATUS;
service_handle : PISC_SVC_HANDLE;
recv_handle : PISC_SVC_HANDLE;
isc_arg4 : UShort;
isc_arg5 : PAnsiChar;
isc_arg6 : UShort;
isc_arg7 : PAnsiChar;
isc_arg8 : UShort;
isc_arg9 : PAnsiChar): ISC_STATUS;
function isc_service_start (status_vector : PISC_STATUS;
service_handle : PISC_SVC_HANDLE;
recv_handle : PISC_SVC_HANDLE;
isc_arg4 : UShort;
isc_arg5 : PAnsiChar): ISC_STATUS;
// Client information functions
procedure isc_get_client_version(buffer : PAnsiChar);
function isc_get_client_major_version: Integer;
function isc_get_client_minor_version: Integer;
function isc_portable_integer(buffer: PAnsiChar;length: Short): ISC_INT64;
procedure FreeIBLibrary;
procedure LoadIBLibrary;
function LibraryLoaded:boolean;
function LibraryFilePath:string;
property LibraryName:string read GetLibName;
property ClientMinorVersion:integer read GetIBClientMinorVersion;
property ClientVersion :integer read GetIBClientVersion;
property Busy:boolean read GetBusy;
end;
{$M+}
EAPICallException =Exception;
TIBClientLibrary = class(TInterfacedObject, IIbClientLibrary)
private
FLibraryHandle:THandle;
FLibraryName:string;
FIBClientVersion :integer;
FIBClientMinorVersion:integer;
private
FBLOB_get : TBLOB_get;
FBLOB_put : TBLOB_put;
Fisc_sqlcode : Tisc_sqlcode;
Ffb_sqlstate : Tfb_sqlstate;
Fisc_sql_interprete : Tisc_sql_interprete;
Fisc_interprete : Tisc_interprete;
Ffb_interpret : Tfb_interpret;
Fisc_vax_integer : Tisc_vax_integer;
Fisc_blob_info : Tisc_blob_info;
Fisc_open_blob2 : Tisc_open_blob2;
Fisc_close_blob : Tisc_close_blob;
Fisc_get_segment :Tisc_get_segment;
Fisc_put_segment :Tisc_put_segment;
Fisc_create_blob2 :Tisc_create_blob2;
Fisc_blob_lookup_desc:Tisc_blob_lookup_desc;
Fisc_blob_set_desc :Tisc_blob_set_desc;
Fisc_cancel_blob :Tisc_cancel_blob ;
Fisc_service_attach : Tisc_service_attach;
Fisc_service_detach : Tisc_service_detach;
Fisc_service_query : Tisc_service_query;
Fisc_service_start : Tisc_service_start;
Fisc_decode_date : Tisc_decode_date;
Fisc_decode_sql_date : Tisc_decode_sql_date;
Fisc_decode_sql_time : Tisc_decode_sql_time;
Fisc_decode_timestamp: Tisc_decode_timestamp;
Fisc_encode_date : Tisc_encode_date;
Fisc_encode_sql_date : Tisc_encode_sql_date;
Fisc_encode_sql_time : Tisc_encode_sql_time;
Fisc_encode_timestamp: Tisc_encode_timestamp;
Fisc_dsql_free_statement: Tisc_dsql_free_statement;
Fisc_dsql_execute2: Tisc_dsql_execute2;
Fisc_dsql_execute: Tisc_dsql_execute;
Fisc_dsql_set_cursor_name: Tisc_dsql_set_cursor_name;
Fisc_dsql_fetch: Tisc_dsql_fetch;
Fisc_dsql_sql_info: Tisc_dsql_sql_info;
Fisc_dsql_alloc_statement2: Tisc_dsql_alloc_statement2;
Fisc_dsql_prepare: Tisc_dsql_prepare;
Fisc_dsql_describe_bind: Tisc_dsql_describe_bind;
Fisc_dsql_describe: Tisc_dsql_describe;
Fisc_dsql_execute_immediate: Tisc_dsql_execute_immediate;
Fisc_dsql_exec_immed2: Tisc_dsql_exec_immed2;
Fisc_drop_database: Tisc_drop_database;
Fisc_detach_database: Tisc_detach_database;
Fisc_attach_database: Tisc_attach_database;
Fisc_database_info: Tisc_database_info;
Fisc_start_multiple: Tisc_start_multiple;
Fisc_commit_transaction: Tisc_commit_transaction;
Fisc_commit_retaining: Tisc_commit_retaining;
Fisc_rollback_transaction: Tisc_rollback_transaction;
Fisc_rollback_retaining: Tisc_rollback_retaining;
Fisc_cancel_events: Tisc_cancel_events;
Fisc_que_events: Tisc_que_events;
Fisc_event_counts: Tisc_event_counts;
Fisc_event_block: Tisc_event_block;
Fisc_free: Tisc_free;
Fisc_wait_for_event:Tisc_wait_for_event;
Fisc_transaction_info:Tisc_transaction_info;
Fisc_prepare_transaction:Tisc_prepare_transaction;
Fisc_prepare_transaction2:Tisc_prepare_transaction2;
//Array functions
Fisc_array_lookup_bounds :Tisc_array_lookup_bounds;
Fisc_array_get_slice :Tisc_array_get_slice;
Fisc_array_put_slice :Tisc_array_put_slice;
Fisc_array_set_desc :Tisc_array_set_desc;
Fisc_array_lookup_desc :Tisc_array_lookup_desc;
Fisc_portable_integer :Tisc_portable_integer;
Fisc_add_user :Tisc_add_user;
Fisc_delete_user:Tisc_delete_user;
Fisc_modify_user:Tisc_modify_user;
{ IB 7.0 functions only}
Fisc_get_client_version : Tisc_get_client_version;
Fisc_get_client_major_version : Tisc_get_client_major_version;
Fisc_get_client_minor_version : Tisc_get_client_minor_version;
//IB2007
Fisc_dsql_batch_execute_immed : Tisc_dsql_batch_execute_immed;
Fisc_dsql_batch_execute : Tisc_dsql_batch_execute;
//FB2.5
Ffb_cancel_operation: Tfb_cancel_operation;
private
FBusy:boolean;
function GetLibName:string;
function GetIBClientVersion: Integer;
function GetIBClientMinorVersion: Integer;
function GetBusy:boolean;
function isc_attach_database(status_vector : PISC_STATUS; db_name_length : Short;
db_name : PAnsiChar; db_handle : PISC_DB_HANDLE;
parm_buffer_length : Short; parm_buffer : PAnsiChar): ISC_STATUS;
function isc_array_get_slice(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
trans_handle : PISC_TR_HANDLE; array_id : PISC_QUAD;
descriptor : PISC_ARRAY_DESC; dest_array : PVoid;
slice_length : ISC_LONG): ISC_STATUS;
function isc_array_lookup_bounds(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
trans_handle : PISC_TR_HANDLE; table_name, column_name : PAnsiChar;
descriptor : PISC_ARRAY_DESC): ISC_STATUS;
function isc_array_lookup_desc(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
trans_handle : PISC_TR_HANDLE; table_name, column_name : PAnsiChar;
descriptor : PISC_ARRAY_DESC): ISC_STATUS;
function isc_array_set_desc(status_vector : PISC_STATUS; table_name : PAnsiChar;
column_name : PAnsiChar; sql_dtype, sql_length, sql_dimensions : PShort;
descriptor : PISC_ARRAY_DESC): ISC_STATUS;
function isc_array_put_slice(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
trans_handle : PISC_TR_HANDLE; array_id : PISC_QUAD;
descriptor : PISC_ARRAY_DESC; source_array : PVoid;
slice_length : PISC_LONG): ISC_STATUS;
function isc_blob_info(status_vector : PISC_STATUS; blob_handle : PISC_BLOB_HANDLE;
item_list_buffer_length : Short; item_list_buffer : PAnsiChar;
result_buffer_length : Short; result_buffer : PAnsiChar): ISC_STATUS;
function isc_blob_lookup_desc(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
trans_handle : PISC_TR_HANDLE; table_name, column_name : PAnsiChar;
descriptor : PISC_BLOB_DESC; global : PUChar): ISC_STATUS;
function isc_blob_set_desc(status_vector : PISC_STATUS; table_name, column_name : PAnsiChar;
subtype, charset, segment_size : Short; descriptor : PISC_BLOB_DESC): ISC_STATUS;
function isc_cancel_blob(status_vector : PISC_STATUS; blob_handle : PISC_BLOB_HANDLE): ISC_STATUS;
function isc_cancel_events(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
event_id : PISC_LONG): ISC_STATUS;
function isc_que_events(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
event_id : PISC_LONG; length : Short; event_buffer : PAnsiChar;
event_function : TISC_CALLBACK; event_function_arg : PVoid): ISC_STATUS;
function isc_wait_for_event (status_vector: PISC_STATUS;
db_handle: PISC_DB_HANDLE;length: Short; event_buffer,result_buffer: PAnsiChar): ISC_STATUS;
function isc_close_blob(status_vector : PISC_STATUS; blob_handle : PISC_BLOB_HANDLE): ISC_STATUS;
function isc_commit_retaining(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE): ISC_STATUS;
function isc_commit_transaction(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE): ISC_STATUS;
function isc_transaction_info(status_vector : PISC_STATUS;
tran_handle : PISC_TR_HANDLE;
item_list_buffer_length : Short;
item_list_buffer : PAnsiChar;
result_buffer_length : Short;
result_buffer : PAnsiChar): ISC_STATUS;
function isc_create_blob2(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
tran_handle : PISC_TR_HANDLE; blob_handle : PISC_BLOB_HANDLE;
blob_id : PISC_QUAD; bpb_length : Short; bpb_address : PAnsiChar): ISC_STATUS;
function isc_database_info(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
item_list_buffer_length : Short; item_list_buffer : PAnsiChar;
result_buffer_length : Short; result_buffer : PAnsiChar): ISC_STATUS;
procedure isc_decode_date(ib_date: PISC_QUAD; tm_date: PCTimeStructure);
procedure isc_decode_sql_date(ib_date: PISC_DATE; tm_date: PCTimeStructure);
procedure isc_decode_sql_time(ib_time: PISC_TIME; tm_date: PCTimeStructure);
procedure isc_decode_timestamp(ib_timestamp: PISC_TIMESTAMP; tm_date: PCTimeStructure);
function isc_detach_database(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE): ISC_STATUS;
function isc_drop_database(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE): ISC_STATUS;
function isc_dsql_alloc_statement2(const status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
stmt_handle : PISC_STMT_HANDLE): ISC_STATUS;
function isc_dsql_describe(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
dialect : UShort; xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_describe_bind(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
dialect : UShort; xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_execute(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
stmt_handle : PISC_STMT_HANDLE; dialect : UShort;
xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_execute2(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
stmt_handle : PISC_STMT_HANDLE; dialect : UShort;
in_xsqlda, out_xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_execute_immediate(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
tran_handle : PISC_TR_HANDLE; length : UShort;
statement : PAnsiChar; dialect : UShort;
xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_exec_immed2(status_vector : PISC_STATUS;
db_handle : PISC_DB_HANDLE;
tran_handle : PISC_TR_HANDLE;
length : UShort;
statement : PAnsiChar;
dialect : UShort;
in_xsqlda,
out_xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_fetch(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
dialect : UShort; xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_free_statement(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
options : UShort): ISC_STATUS;
function isc_dsql_prepare(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
stmt_handle : PISC_STMT_HANDLE; length : UShort;
statement : PAnsiChar; dialect : UShort;
xsqlda : PXSQLDA): ISC_STATUS;
function isc_dsql_set_cursor_name(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
cursor_name : PAnsiChar; _type : UShort): ISC_STATUS;
function isc_dsql_sql_info(status_vector : PISC_STATUS; stmt_handle : PISC_STMT_HANDLE;
item_length : Short; items : PAnsiChar; buffer_length : Short;
buffer : PAnsiChar): ISC_STATUS;
procedure isc_encode_date(tm_date : PCTimeStructure; ib_date : PISC_QUAD);
procedure isc_encode_sql_date(tm_date: PCTimeStructure; ib_date : PISC_DATE);
procedure isc_encode_sql_time(tm_date : PCTimeStructure; ib_time : PISC_TIME);
procedure isc_encode_timestamp(tm_date : PCTimeStructure; ib_timestamp : PISC_TIMESTAMP);
function isc_event_block(event_buffer : PPAnsiChar; result_buffer : PPAnsiChar;
id_count : UShort; event_list : array of PAnsiChar): ISC_LONG;
procedure isc_event_counts(status_vector : PISC_STATUS; buffer_length : Short;
event_buffer : PAnsiChar; result_buffer : PAnsiChar);
function isc_free(isc_arg1 : PAnsiChar): ISC_LONG;
function isc_get_segment(status_vector : PISC_STATUS; blob_handle : PISC_BLOB_HANDLE;
actual_seg_length : PUShort; seg_buffer_length : UShort;
seg_buffer : PAnsiChar): ISC_STATUS;
function isc_put_segment(status_vector : PISC_STATUS; blob_handle : PISC_BLOB_HANDLE;
seg_buffer_len : UShort; seg_buffer : PAnsiChar): ISC_STATUS;
function isc_interprete(buffer : PAnsiChar; status_vector : PPISC_STATUS): ISC_STATUS;
function fb_Interpret(buffer: PAnsiChar; BufLen: ULong;
status_vector : PPISC_STATUS): ISC_STATUS; //FB
function isc_open_blob2(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
tran_handle : PISC_TR_HANDLE; blob_handle : PISC_BLOB_HANDLE;
blob_id : PISC_QUAD; bpb_length : Short; bpb_buffer : PAnsiChar): ISC_STATUS;
function isc_prepare_transaction2(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
msg_length : Short; msg : PAnsiChar): ISC_STATUS;
function isc_rollback_retaining(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE): ISC_STATUS;
function isc_rollback_transaction(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE): ISC_STATUS;
function isc_start_multiple(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
db_handle_count : Short; teb_vector_address : PISC_TEB): ISC_STATUS;
function isc_sqlcode(status_vector : PISC_STATUS): ISC_LONG;
procedure isc_sql_interprete(sqlcode : Short; buffer : PAnsiChar;
buffer_length : Short);
function isc_vax_integer(buffer : PAnsiChar; length : Short): ISC_LONG;
function isc_add_user(status_vector : PISC_STATUS; user_sec_data : PUserSecData): ISC_STATUS;
function isc_delete_user(status_vector : PISC_STATUS; user_sec_data : PUserSecData): ISC_STATUS;
function isc_modify_user(status_vector : PISC_STATUS; user_sec_data : PUserSecData): ISC_STATUS;
function isc_prepare_transaction(status_vector : PISC_STATUS;
tran_handle : PISC_TR_HANDLE): ISC_STATUS;
function BLOB_put(isc_arg1 : Ansichar; isc_arg2 : PBSTREAM): Int;
function BLOB_get(isc_arg1 : PBSTREAM): Int;
// Service manager functions
function isc_service_attach (status_vector : PISC_STATUS;
isc_arg2 : UShort;
isc_arg3 : PAnsiChar;
service_handle : PISC_SVC_HANDLE;
isc_arg5 : UShort;
isc_arg6 : PAnsiChar): ISC_STATUS;
function isc_service_detach(status_vector : PISC_STATUS;
service_handle : PISC_SVC_HANDLE): ISC_STATUS;
function isc_service_query (status_vector : PISC_STATUS;
service_handle : PISC_SVC_HANDLE;
recv_handle : PISC_SVC_HANDLE;
isc_arg4 : UShort;
isc_arg5 : PAnsiChar;
isc_arg6 : UShort;
isc_arg7 : PAnsiChar;
isc_arg8 : UShort;
isc_arg9 : PAnsiChar): ISC_STATUS;
function isc_service_start (status_vector : PISC_STATUS;
service_handle : PISC_SVC_HANDLE;
recv_handle : PISC_SVC_HANDLE;
isc_arg4 : UShort;
isc_arg5 : PAnsiChar): ISC_STATUS;
// Client information functions
procedure isc_get_client_version(buffer : PAnsiChar);
function isc_get_client_major_version: Integer;
function isc_get_client_minor_version: Integer;
function isc_portable_integer(buffer: PAnsiChar;length: Short): ISC_INT64;
//IB2007
function isc_dsql_batch_execute_immed(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
tran_handle : PISC_TR_HANDLE; Dialect : UShort; no_of_sql : ulong;
statement : PPAnsiChar; rows_affected : PULong) : ISC_STATUS;
function isc_dsql_batch_execute(status_vector : PISC_STATUS; tran_handle : PISC_TR_HANDLE;
stmt_handle : PISC_STMT_HANDLE; Dialect : UShort;
insqlda : PXSQLDA; no_of_rows : UShort;
batch_vars : PPXSQLVAR; rows_affected : PULong) : ISC_STATUS;
//FB2.5
function fb_cancel_operation(status_vector : PISC_STATUS; db_handle : PISC_DB_HANDLE;
option : UShort
) : ISC_STATUS;
function fb_sqlstate(user_status: PISC_STATUS):FIBByteString;
public
constructor Create(const aLibName:string);
destructor Destroy;override;
procedure LoadIBLibrary;
procedure FreeIBLibrary;
function LibraryLoaded:boolean;
function LibraryFilePath:string;
end;
{ Library Initialization }
procedure LoadIBInstallLibrary;
procedure FreeIBInstallLibrary;
procedure CheckIBInstallLoaded;
function GetClientLibrary(const aLibName:string):IIbClientLibrary;
const
IBDateDelta = 15018;
{$IFDEF MACOS}
HINSTANCE_ERROR=0;
{$ENDIF}
const
describe_bind_info:array[0..11] of Ansichar =(
AnsiChar(isc_info_sql_bind),
AnsiChar(isc_info_sql_describe_vars),
AnsiChar(isc_info_sql_sqlda_seq),
AnsiChar(isc_info_sql_type),
AnsiChar(isc_info_sql_sub_type),
AnsiChar(isc_info_sql_scale),
AnsiChar(isc_info_sql_length),
AnsiChar(isc_info_sql_field),
AnsiChar(isc_info_sql_relation),
AnsiChar(isc_info_sql_owner),
AnsiChar(isc_info_sql_alias),
AnsiChar(isc_info_sql_describe_end)
);
describe_select_info:array[0..12] of AnsiChar =(
AnsiChar(isc_info_sql_select),
AnsiChar(isc_info_sql_describe_vars),
AnsiChar(isc_info_sql_sqlda_seq),
AnsiChar(isc_info_sql_type),
AnsiChar(isc_info_sql_sub_type),
AnsiChar(isc_info_sql_scale),
AnsiChar(isc_info_sql_length),
AnsiChar(isc_info_sql_field),
AnsiChar(isc_info_sql_relation),
AnsiChar(isc_info_sql_owner),
AnsiChar(isc_info_sql_alias),
AnsiChar(frb_info_sql_relation_alias),
AnsiChar(isc_info_sql_describe_end)
);
var
isc_install_clear_options: Tisc_install_clear_options;
isc_install_execute: Tisc_install_execute;
isc_install_get_info: Tisc_install_get_info;
isc_install_get_message: Tisc_install_get_message;
isc_install_load_external_text: Tisc_install_load_external_text;
isc_install_precheck: Tisc_install_precheck;
isc_install_set_option: Tisc_install_set_option;
isc_uninstall_execute: Tisc_uninstall_execute;
isc_uninstall_precheck: Tisc_uninstall_precheck;
isc_install_unset_option: Tisc_install_unset_option;
implementation
uses FIBConsts;
{$IFDEF LINUX}
const
HINSTANCE_ERROR=$20;
{$ENDIF}
var
{$IFDEF WINDOWS}
IBInstallLibrary: THandle;
{$ENDIF}
{$IFDEF MACOS}
IBInstallLibrary: THandle;
{$ENDIF}
{$IFDEF LINUX}
IBInstallLibrary : Pointer;
{$ENDIF}
vClientLibs:TInterfaceList;
var
vLibAccess: TCriticalSection;
function GetClientLibrary(const aLibName:string):IIbClientLibrary;
var
I: Integer;
begin
vLibAccess.Acquire;
try
for I := 0 to vClientLibs.Count - 1 do
if IIbClientLibrary(vClientLibs[i]).LibraryName=aLibName then
begin
Result:=IIbClientLibrary(vClientLibs[i]) ;
if not Result.LibraryLoaded then
Result.LoadIBLibrary;
Exit;
end;
Result:=TIBClientLibrary.Create(aLibName);
vClientLibs.Add(Result)
finally
vLibAccess.Release
end;
end;
{$IFDEF WINDOWS}
{$IFNDEF D_XE2}
procedure InitFPU;
var
Default8087CW: Word;
begin
asm
FSTCW Default8087CW
OR Default8087CW, 0300h
FLDCW Default8087CW
end;
end;
{$ELSE}
procedure InitFPU;
var
Default8087CW: Word;
asm
FSTCW Default8087CW
OR Default8087CW, 0300h
FLDCW Default8087CW
end;
{$ENDIF}
{$ENDIF}
{$DEFINE FP_STDCALL}
function isc_install_clear_options_stub(hOption: POPTIONS_HANDLE):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_clear_options',IB_INSTALL_DLL]));
end;
function isc_install_execute_stub(hOption: OPTIONS_HANDLE;
src_dir: TEXT;
dest_dir: TEXT;
status_func: FP_STATUS;
status_data: pointer;
error_func: FP_ERROR;
error_data: pointer;
uninstal_file_name: TEXT):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_execute_stub',IB_INSTALL_DLL]));
end;
function isc_install_get_info_stub(info_type :integer;
option :OPT;
info_buffer : Pointer;
buf_len : Cardinal): MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_get',IB_INSTALL_DLL]));
end;
function isc_install_get_message_stub(hOption: OPTIONS_HANDLE;
message_no: MSG_NO;
message_txt: Pointer;
message_len: Cardinal):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_get_message',IB_INSTALL_DLL]));
end;
function isc_install_load_external_text_stub(msg_file_name: TEXT):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_load_external_text',IB_INSTALL_DLL]));
end;
function isc_install_precheck_stub(hOption: OPTIONS_HANDLE;
src_dir: TEXT;
dest_dir: TEXT):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_precheck',IB_INSTALL_DLL]));
end;
function isc_install_set_option_stub(hOption: POPTIONS_HANDLE;
option: OPT):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_set_option',IB_INSTALL_DLL]));
end;
function isc_uninstall_execute_stub(uninstall_file_name: TEXT;
status_func: FP_STATUS;
status_data: pointer;
error_func: FP_ERROR;
error_data: pointer):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_uninstall_execute',IB_INSTALL_DLL]));
end;
function isc_uninstall_precheck_stub(uninstall_file_name: TEXT):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_uninstall_precheck',IB_INSTALL_DLL]));
end;
function isc_install_unset_option_stub(hOption: POPTIONS_HANDLE;
option: OPT):MSG_NO;
{$I pFIBMacroComp.inc}
begin
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_install_unset_option',IB_INSTALL_DLL]));
end;
{$UNDEF FP_STDCALL}
procedure LoadIBInstallLibrary;
{$IFDEF WINDOWS}
function GetProcAddr(ProcName: PAnsiChar): Pointer;
begin
Result := GetProcAddress(IBInstallLibrary, ProcName);
if not Assigned(Result) then
{$IFNDEF D6+}
RaiseLastWin32Error;
{$ELSE}
RaiseLastOSError
{$ENDIF}
end;
{$ENDIF}
{$IFDEF LINUX}
function GetProcAddr(ProcName : PAnsiChar) : Pointer;
begin
Result := dlsym(IBInstallLibrary, ProcName);
end;
{$ENDIF}
{$IFDEF MACOS}
function GetProcAddr(ProcName: PWideChar): Pointer;
begin
Result := GetProcAddress(IBInstallLibrary, ProcName);
if not Assigned(Result) then
{$IFNDEF D6+}
RaiseLastWin32Error;
{$ELSE}
RaiseLastOSError
{$ENDIF}
end;
{$ENDIF}
begin
{$IFDEF WINDOWS}
IBInstallLibrary := LoadLibrary(PChar(IB_INSTALL_DLL));
if (IBInstallLibrary > HINSTANCE_ERROR) then
{$ENDIF}
{$IFDEF MACOS}
IBInstallLibrary := LoadLibrary(PChar(IB_INSTALL_DLL));
if (IBInstallLibrary <> 0) then
{$ENDIF}
{$IFDEF LINUX}
IBInstallLibrary := dlopen(PAnsiChar(IB_INSTALL_DLL), 0);
if (IBInstallLibrary <> nil) then
{$ENDIF}
begin
isc_install_clear_options := GetProcAddr('isc_install_clear_options');
isc_install_execute := GetProcAddr('isc_install_execute');
isc_install_get_info := GetProcAddr('isc_install_get_info');
isc_install_get_message := GetProcAddr('isc_install_get_message');
isc_install_load_external_text := GetProcAddr('isc_install_load_external_text');
isc_install_precheck := GetProcAddr('isc_install_precheck');
isc_install_set_option := GetProcAddr('isc_install_set_option');
isc_uninstall_execute := GetProcAddr('isc_uninstall_execute');
isc_uninstall_precheck := GetProcAddr('isc_uninstall_precheck');
isc_install_unset_option := GetProcAddr('isc_install_unset_option');
end
else
begin
isc_install_clear_options := isc_install_clear_options_stub;
isc_install_execute := isc_install_execute_stub;
isc_install_get_info := isc_install_get_info_stub;
isc_install_get_message := isc_install_get_message_stub;
isc_install_load_external_text := isc_install_load_external_text_stub;
isc_install_precheck := isc_install_precheck_stub;
isc_install_set_option := isc_install_set_option_stub;
isc_uninstall_execute := isc_uninstall_execute_stub;
isc_uninstall_precheck := isc_uninstall_precheck_stub;
isc_install_unset_option := isc_install_unset_option_stub;
end;
{$IFDEF WINDOWS}
InitFPU
{$ENDIF}
end;
procedure FreeIBInstallLibrary;
begin
{$IFDEF WINDOWS}
if IBInstallLibrary > HINSTANCE_ERROR then
begin
FreeLibrary(IBInstallLibrary);
IBInstallLibrary := 0;
end;
{$ENDIF}
{$IFDEF LINUX}
if IBInstallLibrary <> nil then
begin
dlclose(IBInstallLibrary);
IBInstallLibrary := nil;
end;
{$ENDIF}
end;
procedure CheckIBInstallLoaded;
begin
{$IFDEF WINDOWS}
if (IBInstallLibrary <= HINSTANCE_ERROR) then
LoadIBInstallLibrary;
if (IBInstallLibrary <= HINSTANCE_ERROR) then
{$ENDIF}
{$IFDEF LINUX}
if (IBInstallLibrary = nil) then
LoadIBInstallLibrary;
if (IBInstallLibrary = nil) then
{$ENDIF}
raise
EAPICallException.Create(Format(SCantLoadLibrary,[IB_INSTALL_DLL]));
end;
{ TIBClientLibrary }
function TIBClientLibrary.BLOB_get(isc_arg1: PBSTREAM): Int;
begin
if Assigned(FBLOB_get) then
Result:= FBLOB_get(isc_arg1)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['BLOB_get',FLibraryName]));
end;
function TIBClientLibrary.BLOB_put(isc_arg1: AnsiChar;
isc_arg2: PBSTREAM): Int;
begin
if Assigned(FBLOB_put) then
Result:= FBLOB_put(isc_arg1,isc_arg2)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['BLOB_put',FLibraryName]));
end;
function TIBClientLibrary.GetIBClientVersion: Integer;
begin
Result := FIBClientVersion
end;
function TIBClientLibrary.GetIBClientMinorVersion: Integer;
begin
Result := FIBClientMinorVersion
end;
function TIBClientLibrary.GetLibName: string;
begin
Result:=FLibraryName
end;
function TIBClientLibrary.isc_array_get_slice(status_vector: PISC_STATUS;
db_handle: PISC_DB_HANDLE; trans_handle: PISC_TR_HANDLE;
array_id: PISC_QUAD; descriptor: PISC_ARRAY_DESC; dest_array: PVoid;
slice_length: ISC_LONG): ISC_STATUS;
begin
if Assigned(Fisc_array_get_slice) then
Result:=
Fisc_array_get_slice(
status_vector, db_handle,trans_handle,array_id,descriptor,dest_array,slice_length
)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_array_get_slice',FLibraryName]));
end;
function TIBClientLibrary.isc_array_lookup_bounds(
status_vector: PISC_STATUS; db_handle: PISC_DB_HANDLE;
trans_handle: PISC_TR_HANDLE; table_name, column_name: PAnsiChar;
descriptor: PISC_ARRAY_DESC): ISC_STATUS;
begin
if Assigned(Fisc_array_lookup_bounds) then
Result:=
Fisc_array_lookup_bounds(
status_vector, db_handle,trans_handle, table_name, column_name,descriptor
)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_array_lookup_bounds',FLibraryName]));
end;
function TIBClientLibrary.isc_array_lookup_desc(status_vector: PISC_STATUS;
db_handle: PISC_DB_HANDLE; trans_handle: PISC_TR_HANDLE; table_name,
column_name: PAnsiChar; descriptor: PISC_ARRAY_DESC): ISC_STATUS;
begin
if Assigned(Fisc_array_lookup_desc) then
Result:=
Fisc_array_lookup_desc(
status_vector, db_handle,trans_handle, table_name, column_name,descriptor
)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_array_lookup_desc',FLibraryName]));
end;
function TIBClientLibrary.isc_array_put_slice(status_vector: PISC_STATUS;
db_handle: PISC_DB_HANDLE; trans_handle: PISC_TR_HANDLE;
array_id: PISC_QUAD; descriptor: PISC_ARRAY_DESC; source_array: PVoid;
slice_length: PISC_LONG): ISC_STATUS;
begin
if Assigned(Fisc_array_put_slice) then
Result:=
Fisc_array_put_slice(
status_vector, db_handle,trans_handle, array_id,descriptor,source_array, slice_length
)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_array_put_slice',FLibraryName]));
end;
function TIBClientLibrary.isc_array_set_desc(status_vector: PISC_STATUS;
table_name, column_name: PAnsiChar; sql_dtype, sql_length,
sql_dimensions: PShort; descriptor: PISC_ARRAY_DESC): ISC_STATUS;
begin
if Assigned(Fisc_array_set_desc) then
Result:=
Fisc_array_set_desc(
status_vector, table_name, column_name,sql_dtype, sql_length, sql_dimensions,descriptor
)
else
raise
EAPICallException.Create(Format(SCantFindApiProc,['isc_array_set_desc',FLibraryName]));
end;
function TIBClientLibrary.isc_attach_database(status_vector: PISC_STATUS;
db_name_length: Short; db_name: PAnsiChar; db_handle: PISC_DB_HANDLE;
parm_buffer_length: Short; parm_buffer: PAnsiChar): ISC_STATUS;
begin
FBusy:=True;