Hi all,
I create a database on SQL 2005 Express edition and link it to a C++/MFC application as follows. It wont gives any compile time errors. But at run time, it gives an error. Here are details.
Link the database in OnInitDialog()
here is the code
BOOL CSRFDBDlg::OnInitDialog()
{
CDatabase srfDB ;
CString srfNAME ;
srfNAME = "ODBC; DSN=.SQLEXPRESS; UID=sa; PWD=sa123; DATABASE=srfdb.mdf" ;
srfDB.Open(srfNAME) ;
if(srfDB.IsOpen())
{
AfxMessageBox("ok") ;
}
srfDB.Close() ;
}
Gives the following runtime error
Data source name not found and no default driver specified
Can you guys tell me where I'm going wrong....