Homework #6 was modified and is now your final exam as well as homework. Your goal is to create the COM server, and the testing program, and also to create an ASP page that demonstrates the COM server in action.
The following is a list of points concerning the change from a homework assignment to being your final exam:
In addition to the above, the following changes should be implemented into your source code to make the COM server able to be used in ASP pages:
You must use the CDatabase::NoOdbcDialog option when logging into the database. Doing this means several changes, specifically:
m_pClient = 0; m_DB.OpenEx(_T("DSN=MGSales"), CDatabase::noOdbcDialog); m_pClient = new CClientSet( & m_DB );
The noOdbcDialog flag is needed so that the ODBC system does not pop up any dialogs if not enough information were supplied for the connection. Even though we don't need to provide any additional information, the ODBC system won't recognize that up front. If we call any function in ODBC that could potentially display a dialog, that function will terminate when called by an ISAPI extension (like ASP). So, we open the m_DB database connection, and then create the recordset for client access to use the open m_DB connection.
Note: If you have problems doing the AddNew function, and MFC throws an exception when you try and perform the update, you may want to make sure that your CClientSet class is a dynaset recordset. This may be required for some older Access database ODBC drivers. Change the line in the CClientSet Constructor that changes m_nDefaultType to look like the following:
m_nDefaultType = dynaset;