I had developed a database on window platform with SQL Server as background database, now I want to restore the database in the program. As is known, we must close current connection before the operation. I know the SQL Server had a master database for default, I don't want to create this DSN by hand, Can I dynamicly create a dsn for the program? I find a example for Access database, but no example for SQL Server!
Qt Code:
... db.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=myaccessfile.mdb"); if (db.open()) { // success! } ...To copy to clipboard, switch view to plain text mode
Bookmarks