This article refers to the various great God articles, thanks here, the project requires the connection of Oracle database, do not install Oracle client, while supporting 32-bit and 64-bit applications, experiments have been organized many times.
1. Implementation \unidac -sRC\source\delphi +\make.baT. 2,Finishintoafterin theMeshRecord Generate BPL in \unidac55src\bin\delphi21\win64\ and $\unidac55src\bin\delphi21\win32\.
2, put $\unidac55src\bin\delphi21\win32\ directory under *.BPL
Copy to C:\Users\Public\Documents\Embarcadero\Studio\15.0\Bpl\.
3, the \unidac -sRC\sourceand the \unidac55src\source\uniproviders\oracle Directory added to Delphi's Library Path,
The action path is: Tools->options->environment Options->delphi options->library, entered in the library path.
4, open the Delphi XE7,
Component->install Packages
Install C:\USERS\PUBLIC\DOCUMENTS\EMBARCADERO\STUDIO\15.0\BPL\DCLUNIDAC210.BPL.
6, planning the project file path, the establishment of PAS, DCU, THIRDPARTY_UNIDAC\DCU, project options are set as follows:
The same settings for 64-bit platforms are saved to the PAS directory for the new unit files in the project.
7, compile needs to add $\unidac55src\lib\delphi21\win32\ as follows DCU
To the project catalog THIRDPARTY_UNIDAC\DCU,
Oracalluni.dcu
Oraclassesuni.dcu
Oracleuniprovider.dcu
Oraconnectionpooluni.dcu
Oraconnectionstringuni.dcu
Oraconstsuni.dcu
Oradatatypemapuni.dcu
Oradatetimeuni.dcu
Oraerroruni.dcu
Oraintervaluni.dcu
Oranumberuni.dcu
Oraobjectsuni.dcu
Oraparseruni.dcu
Orascriptprocessoruni.dcu
Oraservicesuni.dcu
Orasqlgeneratoruni.dcu
7. When compiling a 32-bit program, copy \unidac -sRC\lib\delphi +\win +\oranetuni.d Cuto theworkProcessMeshRecordunder,whencompilationtranslation -bitProcessOrderwhen,CuffShellfish \UNIDAC55SRC\LIB\DELPHI21\WIN64\ORANETUNI.DCU to the project directory.
Choose a different 64bit target platform add command:
Copy.. \DOC\ORANET\X64\ORANETUNI.DCU. \THIRDPARTY_UNIDAC\DCUORANETUNI.DCU to Project Options->build Events->pre-build Events->commands
Choose a different 32bit target platform add command:
Copy.. \DOC\ORANET\X86\ORANETUNI.DCU. \THIRDPARTY_UNIDAC\DCUORANETUNI.DCU to
Project Options->build Events->pre-build Events->commands
8, New VCL Project, open the window, in tool palette find UNIDAC providers open,
Add the Toracleuniprovider control, open Unidac, add tuniconnection, double-click Control settings Provider for Oracle, set options->direct=true.
Test code:
uniconnection1.specificoptions.values[' connectiontimeout ': = ' 3 ';
Uniconnection1.server: = ' 192.168.37.130:1521:ORCL ';
Uniconnection1.username: = ' Hello ';
Uniconnection1.password: = ' Hello ';
Try
Uniconnection1.connect;
ShowMessage (' OK ');
Except
On E:exception do
Begin
ShowMessage (E.message);
End
End
UNIDAC55 instructions for use in DelphiXE7