CDatabase database; CString SqlString; CString sDriver = "SQL Server"; CString sDsn; CString sFile = "C:\\MyFolder\\Libraries.mdf"; sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,sFile); // Open the database if(database.Open(NULL,false,false,sDsn)) AfxMessageBox("database opened!"); else{ ..... }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)