65 |
|
procedure TTest1.RunTest(CharSet: string; SQLDialect: integer); |
66 |
|
var DPB: IDPB; |
67 |
|
Attachment: IAttachment; |
68 |
< |
DBInfo: IDBInformation; |
69 |
< |
ConType: integer; |
70 |
< |
DBFileName: string; |
71 |
< |
DBSiteName: string; |
68 |
> |
createSQL: string; |
69 |
|
begin |
70 |
|
writeln(OutFile,'Creating a Database with empty parameters'); |
71 |
|
Attachment := FirebirdAPI.CreateDatabase('',nil,false); |
74 |
|
else |
75 |
|
Attachment.DropDatabase; |
76 |
|
|
77 |
+ |
writeln(OutFile,'Creating a Database using an SQL Statement'); |
78 |
+ |
createSQL := Format('CREATE DATABASE ''%s'' USER ''%s'' PASSWORD ''%s'' DEFAULT CHARACTER SET %s', |
79 |
+ |
[Owner.GetNewDatabaseName, Owner.GetUserName, Owner.GetPassword, CharSet]); |
80 |
+ |
Attachment := FirebirdAPI.CreateDatabase(createSQL,SQLDialect); |
81 |
+ |
WriteDBInfo(Attachment.GetDBInformation([isc_info_db_id,isc_info_db_SQL_Dialect])); |
82 |
+ |
|
83 |
+ |
writeln(OutFile,'Dropping Database'); |
84 |
+ |
if Attachment <> nil then |
85 |
+ |
Attachment.DropDatabase; |
86 |
+ |
|
87 |
|
writeln(OutFile,'Creating a Database with a DPD'); |
88 |
|
DPB := FirebirdAPI.AllocateDPB; |
89 |
|
DPB.Add(isc_dpb_user_name).setAsString(Owner.GetUserName); |
107 |
|
writeln(OutFile,'Create Database Failed'); |
108 |
|
Exit; |
109 |
|
end; |
110 |
< |
DBInfo := Attachment.GetDBInformation([isc_info_db_id]); |
104 |
< |
DBInfo[0].DecodeIDCluster(ConType,DBFileName,DBSiteName); |
105 |
< |
writeln(OutFile,'Database ID = ', ConType,' FB = ', DBFileName, ' SN = ',DBSiteName); |
106 |
< |
DBInfo := Attachment.GetDBInformation([isc_info_ods_version]); |
107 |
< |
write(OutFile,'ODS major = ',DBInfo[0].getAsInteger); |
108 |
< |
DBInfo := Attachment.GetDBInformation([isc_info_ods_minor_version]); |
109 |
< |
writeln(OutFile,' minor = ', DBInfo[0].getAsInteger ); |
110 |
> |
WriteDBInfo(Attachment.GetDBInformation([isc_info_db_id,isc_info_ods_version,isc_info_ods_minor_version])); |
111 |
|
|
112 |
|
{Querying Database} |
113 |
|
DoQuery(Attachment); |