数据库浏览器的一段代码,该如何解决
数据库浏览器的一段代码
在头文件.h中
在.cpp中
[BCC32 Error] sysdyn.h(285): E2328 Classes with properties cannot be copied by value
[BCC32 Error] sysdyn.h(347): E2285 Could not find a match for 'TSQLConnection::TSQLConnection()'
在头文件.h中
- C/C++ code
typedef union{ bool SupportsProcedures; bool SupportsViews; bool SupportsSynonyms; bool SupportsSysTables; bool SupportsADTs; bool SupportsArrays; bool CheckConnection; }TDriverInfo,*PDriverInfo; bool __fastcall GetDriverInfo(String Driver,TDriverInfo Info); private: // User declarations int ConnectionCount;
在.cpp中
- C/C++ code
//--------------------------------------- const String SProcedures="Procedures"; const String SViews="Views"; const String SSynonyms="Synonyms"; const String SSysTables ="System Tables"; const String SCheckConnectionKey ="CheckConnection"; const String SADTS="ADTS"; const String SArrays = "ARRAYS"; const String SGETARRAYS ="GETARRAYS"; const String SExplorerIni ="..\\dbxexpl.ini" ; //--------------------------------------- bool __fastcall TForm2::GetDriverInfo(String Driver,TDriverInfo Info) { TMemIniFile *Ini; bool Result=true; AnsiString FilePath=ExtractFilePath(Application->ExeName); try { Ini=new TMemIniFile(FilePath+"dbxexpl.ini"); if(UpperCase(Ini->ReadString(Driver,SProcedures,"False"))== "TRUE" ) Info.SupportsProcedures = true; if(UpperCase(Ini->ReadString(Driver, SViews,"False"))== "TRUE" ) Info.SupportsViews = true; if (UpperCase(Ini->ReadString(Driver, SSynonyms,"False"))== "TRUE" ) Info.SupportsSynonyms = true; if (UpperCase(Ini->ReadString(Driver, SSysTables,"False"))== "TRUE" ) Info.SupportsSysTables = true; if (UpperCase(Ini->ReadString(Driver, SCheckConnectionKey,""))!="") Info.CheckConnection = true; if (UpperCase(Ini->ReadString(Driver, SADTS,"False"))== "TRUE" ) if (Ini->ReadString(Driver,"GetADTS","")!="") Info.SupportsADTs = true; if (UpperCase(Ini->ReadString(Driver, SArrays,"False"))== "TRUE" ) if(Ini->ReadString(Driver, SGETARRAYS, "")!="") Info.SupportsArrays = true; } __finally {delete Ini; } return Result; } //--------------------------------------- void __fastcall TForm2::FormCreate(TObject *Sender) { DynamicArray <PDriverInfo> DriverInfo; DynamicArray <TSQLConnection> Connections; int I, J; //SetDBControlsVisible(false); ConnectionCount= 0; TStringList *DriverList=new TStringList(); TStringList *ConnectionList= new TStringList(); GetDriverNames(DriverList); DriverInfo.Length= DriverList->Count; for (I = 0;I<DriverList->Count;I++) { GetDriverInfo(DriverList->Strings[I],*DriverInfo[I]); TreeView1->Items->AddChildObject(TreeView1->Items->Item[0],DriverList->Strings[I],DriverInfo[I]); GetConnectionNames(ConnectionList,DriverList->Strings[I],false); for( J = 0;J<ConnectionList->Count;J++) { Connections.Length=ConnectionCount+1 ; // Connections[ConnectionCount] =new TSQLConnection(Self); TreeView1->Items->AddChildObject(TreeView1->Items->Item[0]->GetLastChild(), ConnectionList->Strings[J],Connections[I]); ConnectionCount++; } } delete DriverList; delete ConnectionList; Memo1->Visible = false; SpeedButton1->Visible = false; }
[BCC32 Error] sysdyn.h(285): E2328 Classes with properties cannot be copied by value
[BCC32 Error] sysdyn.h(347): E2285 Could not find a match for 'TSQLConnection::TSQLConnection()'