1 |
|
unit Test1; |
2 |
|
{$IFDEF MSWINDOWS} |
3 |
|
{$DEFINE WINDOWS} |
4 |
+ |
{$IF defined(CompilerVersion) and (CompilerVersion >= 28)} |
5 |
+ |
{Delphi XE7 onwards}} |
6 |
+ |
{$define HASREQEX} |
7 |
+ |
{$IFEND} |
8 |
|
{$ENDIF} |
9 |
|
|
10 |
|
{Create and Drop a Database} |
21 |
|
{$IFDEF FPC} |
22 |
|
{$mode delphi} |
23 |
|
{$codepage utf8} |
24 |
+ |
{$define HASREQEX} |
25 |
|
{$ENDIF} |
26 |
|
|
27 |
|
interface |
97 |
|
writeln(outfile,'DB ODS Minor Version = ',Attachment.GetODSMinorVersion); |
98 |
|
PrintDPB(Attachment.getDPB); |
99 |
|
|
100 |
+ |
{$IFDEF HASREQEX} |
101 |
|
{Demonstrate reconnect when database created with SQL Statement} |
102 |
< |
Attachment.Disconnect; |
103 |
< |
Attachment.Connect; |
102 |
> |
try |
103 |
> |
Attachment.Disconnect; |
104 |
> |
Attachment.Connect; |
105 |
> |
except on E:Exception do |
106 |
> |
writeln(OutFile,'Error reconnecting to Database: ',E.Message); |
107 |
> |
end; |
108 |
> |
{$ENDIF} |
109 |
|
|
110 |
|
writeln(OutFile,'Dropping Database'); |
111 |
|
if Attachment <> nil then |