Databases and C++
-
Hi everyone, The problem I've got is that I need to open a database (*.mdb, the filename is choosen by the user) and then write rows (recordset?) of data to different tables within the database (the names of the tables will never change, but the tables will not contain any data at the start of the run apart from the field names). However there are some constraints: 1) I cant use anything to do with JET 2) I can include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!) not sure if I've made this clear enough.... but if anyone has any suggestions and can provide links to websites which contain non-mfc database code samples. many thanks Andy McSherry
-
Hi everyone, The problem I've got is that I need to open a database (*.mdb, the filename is choosen by the user) and then write rows (recordset?) of data to different tables within the database (the names of the tables will never change, but the tables will not contain any data at the start of the run apart from the field names). However there are some constraints: 1) I cant use anything to do with JET 2) I can include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!) not sure if I've made this clear enough.... but if anyone has any suggestions and can provide links to websites which contain non-mfc database code samples. many thanks Andy McSherry
Hi, Your post does not state clearly what the problem is. However, if you want to use non-mfc based database library, you can try using ADO. Try: http://www.developerfusion.com/show/4033/1/[^] Hope, it helps. Pankaj Without struggle, there is no progress
-
Hi everyone, The problem I've got is that I need to open a database (*.mdb, the filename is choosen by the user) and then write rows (recordset?) of data to different tables within the database (the names of the tables will never change, but the tables will not contain any data at the start of the run apart from the field names). However there are some constraints: 1) I cant use anything to do with JET 2) I can include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!) not sure if I've made this clear enough.... but if anyone has any suggestions and can provide links to websites which contain non-mfc database code samples. many thanks Andy McSherry
- should read 2)I can't #include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!)
-
Hi, Your post does not state clearly what the problem is. However, if you want to use non-mfc based database library, you can try using ADO. Try: http://www.developerfusion.com/show/4033/1/[^] Hope, it helps. Pankaj Without struggle, there is no progress
-
cheers Pankaj it looks like the link you gave me has what I need to do! (I did look at ADO before but all the examples talked about JET, which meant I didnt delve too far into it) many thanks, Andy
mcsherry wrote: I did look at ADO before but all the examples talked about JET, which meant I didnt delve too far into it) The Microsoft Access Databases uses the JET engine, so you cannot avoid this. You will have to interact with the JET engine to communicate with the database no matter what method you use. Maybe your boss was taking about not using a specific technology (MFC's DAO classes, for example)?
I Dream of Absolute Zero
-
- should read 2)I can't #include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!)
Sorry, replied above before reading this ammendment. Those include files are MFC's database classes CDAOXXXX. ADO is definitely the way to go. You can find one or two very good ADO wrapper classes right here in CP to use in your project.
I Dream of Absolute Zero
-
- should read 2)I can't #include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!)