I Googled this a bit and found out that ODBC is pretty old, but I was wondering how to do this using just MFC. If I got it correctly, I have to use CDatabase, but I'm not sure how to continue. I've found out how to use a Access database (.mdb), but I have no idea about how to do it when it comes to SQL Server 2008. Thanks for your help!