CDatabase && CRecordSet
-
Hello, In terms of performance, good programming, etc, is it better to derive [customized] classes from
CDatabase
andCRecordSet
or is it preferable to build our own from scratch? What do you think about this? What I am trying to know is whether a Database Programmer finds all the functionalities he/she needs in theseMFC
classes or whether they'd be better off creating their own from scratch. All insights on the subject are very much appreciated. :) Thank you, David -
Hello, In terms of performance, good programming, etc, is it better to derive [customized] classes from
CDatabase
andCRecordSet
or is it preferable to build our own from scratch? What do you think about this? What I am trying to know is whether a Database Programmer finds all the functionalities he/she needs in theseMFC
classes or whether they'd be better off creating their own from scratch. All insights on the subject are very much appreciated. :) Thank you, DavidAFAIK CDatabase, CRectordset, etc, connects to a database by using ODBC driver, and that way of connection is always slower than accessing directly database native driver, as it adds other layer to the database connection. They are easy to use, bad provide poor performance. To connect to database I programmed my own class named CDatabase that encapsulates all database connection using ADO. It's known that by using ADO, the program doesn't access directly the database driver, but it's only one layer over the OLEDB driver, being a good choice (and easy choice) to access a database. Jaime
-
AFAIK CDatabase, CRectordset, etc, connects to a database by using ODBC driver, and that way of connection is always slower than accessing directly database native driver, as it adds other layer to the database connection. They are easy to use, bad provide poor performance. To connect to database I programmed my own class named CDatabase that encapsulates all database connection using ADO. It's known that by using ADO, the program doesn't access directly the database driver, but it's only one layer over the OLEDB driver, being a good choice (and easy choice) to access a database. Jaime
But what kind of database(s) do you usually use? MsAccess and the likes, or Oracle/... ? I am asking this because I heard something before about the ADO technology only allowing you to connect to the
Microsoft Jet
-type databases. Is this right? dNimrod#X ________________________ -
But what kind of database(s) do you usually use? MsAccess and the likes, or Oracle/... ? I am asking this because I heard something before about the ADO technology only allowing you to connect to the
Microsoft Jet
-type databases. Is this right? dNimrod#X ________________________it's wrong. ADO can connect to any database that has supporting driver installed in the system. I have used it in Access (Microsoft Jet), SQL Server (SQLOLEDB) and Oracle (MSDAORA) Jaime
-
it's wrong. ADO can connect to any database that has supporting driver installed in the system. I have used it in Access (Microsoft Jet), SQL Server (SQLOLEDB) and Oracle (MSDAORA) Jaime
I see! I hope you'll bear with me, I am a newbee in database programming... :wtf: Let me ask you though, is there any MFC class supporting
ADODB
connections?, I've been searching but found none... For what I could see, ADODB connections are a form of interacting with databases through OLE ? -
I see! I hope you'll bear with me, I am a newbee in database programming... :wtf: Let me ask you though, is there any MFC class supporting
ADODB
connections?, I've been searching but found none... For what I could see, ADODB connections are a form of interacting with databases through OLE ?MFC doesn't provide a class for connecting to database using ADODB, that's why I programmed my own CDatabase class that #imports the ADO DLL to use the wrapper classes, and call the more common methods, for example, Execute to execute a query. In order to fully understand, you need knowledge on COM technology. I think here in codeproject you may be able to find info on this topic (in www.google.cl you can find a lot of stuff, for sure) Jaime
-
MFC doesn't provide a class for connecting to database using ADODB, that's why I programmed my own CDatabase class that #imports the ADO DLL to use the wrapper classes, and call the more common methods, for example, Execute to execute a query. In order to fully understand, you need knowledge on COM technology. I think here in codeproject you may be able to find info on this topic (in www.google.cl you can find a lot of stuff, for sure) Jaime
Thanks a lot for all the input, Eduardo! Cheers, David
-
Thanks a lot for all the input, Eduardo! Cheers, David
you are welcome... but my name isn't Eduardo, it is Jaime, and my surname Stuardo :)
-
you are welcome... but my name isn't Eduardo, it is Jaime, and my surname Stuardo :)
I am sorry for having mixed up your name, Jaime! Again, thanks for the help! :) David
-
Hello, In terms of performance, good programming, etc, is it better to derive [customized] classes from
CDatabase
andCRecordSet
or is it preferable to build our own from scratch? What do you think about this? What I am trying to know is whether a Database Programmer finds all the functionalities he/she needs in theseMFC
classes or whether they'd be better off creating their own from scratch. All insights on the subject are very much appreciated. :) Thank you, David