6

SQL2008 express with ODCB conenction

view full story
linux-howto

http://serverfault.com – I'm now to SQL server. I'm working with a MFC application to store data into a SQL database in my local system. After I create a database in SQL2008 management studio, now i need to open/connect it uisng my application. I'm using window authntication. My codes as follows: //my codes CDatabase database; CString SqlString; CString sCatID, sCategory; CString sDriver = "SQL Server"; CString sDsn, sMc; sMc ="localhost"; CString sFile = "C:\\MySPOIS\\Library.mdf"; // Build ODBC connection string sDsn.Format("ODBC;DRIVER={%s};Server=%s;Database=%s;Trusted_Connection=yes;",sDriver,sMc (HowTos)