13,870
社区成员




#include "System.RegularExpressionsCore.hpp"
TStrings * __fastcall TTools::LoadTNSNames(String OracleHomeRegistryKey) {
TStringList * DBNamesCollection = new TStringList;
String strTNSNAMESORAFilePath =
GetTNSNAMESORAFilePath(OracleHomeRegistryKey);
if (strTNSNAMESORAFilePath != "") {
// check out that file does physically exists
if (FileExists(strTNSNAMESORAFilePath)) {
String str;
// read tnsnames.ora file
int File, FileLength;
File = FileOpen(strTNSNAMESORAFilePath,
fmOpenRead | fmShareDenyNone); // 打开指定文件
FileLength = FileSeek(File, 0, 2); // 取文件长度
FileSeek(File, 0, 0);
char *pszBuffer = new char[FileLength + 1]; // 设pszBUffer的长度和文件的长度一致
FileRead(File, pszBuffer, FileLength); // 读文件
String WStr = pszBuffer;
TPerlRegEx *r = new TPerlRegEx();
r->Subject = WStr;
r->RegEx = "[\\n][\\s]*[^\\(][a-zA-Z0-9_.]+[\\s]*=[\\s]*\\(";
r->Replacement = "";
while (r->MatchAgain()) {
// ShowMessage(r->MatchedText.SubString(0,r->MatchedText.Pos(" ")));
DBNamesCollection->Add(r->MatchedText.SubString(0,
r->MatchedText.Pos(" ")).Trim());
}
r->Free();
delete[]pszBuffer;
}
}
else {
ShowMessage("请确认系统中已安装ORACLE客户端,并正确配置");
}
return DBNamesCollection;
}
[ilink32 Error] Error: Unresolved external 'toupper' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'tolower' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'isupper' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'islower' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'isgraph' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'isprint' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'ispunct' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'iscntrl' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'isspace' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'isalpha' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'isdigit' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'isxdigit' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'isalnum' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'strchr' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'strncmp' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'memmove' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unresolved external 'memcmp' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\12.0\LIB\WIN32\RELEASE\RTL.LIB|System.RegularExpressionsAPI
[ilink32 Error] Error: Unable to perform link