Click here to Skip to main content
15,893,486 members

Comments by sally8998 (Top 7 by date)

sally8998 20-Mar-13 4:23am View    
I had got my problem solved by myself. Thank you.
sally8998 12-Jun-12 0:12am View    
Finally I make it! The server and database were not correct. Thanks, barneyman!
sally8998 11-Jun-12 21:47pm View    
It still failed even I changed it to:

CDatabase database;
CString SqlString;
CString sDriver = "SQL Server";
CString sDsn, sMc;
sMc.Format("localhost");
CString sFile = "C:\\MyFolder\\Libraries.mdf";

sDsn.Format("ODBC;DRIVER={%s};Server=%s;Database=%s;Trusted_Connection=yes",sDriver,sMc,sFile);


// Open the database
if(database.Open(NULL,false,false,sDsn))
AfxMessageBox("database opened!");
sally8998 11-Jun-12 20:56pm View    
Dear barneyman, I had got SQL2008 express installed in my system. I checked the web you suggested, if the database is in my local machine, what should i put for the "server" for the connection string? Thanks!
sally8998 7-Dec-11 3:03am View    
Thanks for the lesson.