how to create a user name and password for a database ?
-
Hi, can any body help me in creating a username and password for the database programmatically.I am connecting to the database like this: CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)"; CString sDsn; TCHAR sError[100]; sDsn.Format(_T("ODBC;DRIVER={%s};DSN='';DBQ=%s"),sDriver,sDatabase); try { m_pDatabase->Open(NULL,false,false,sDsn); } catch(CDBException* e) { e->GetErrorMessage(sError,100); AfxMessageBox(sError); } :confused:
-
Hi, can any body help me in creating a username and password for the database programmatically.I am connecting to the database like this: CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)"; CString sDsn; TCHAR sError[100]; sDsn.Format(_T("ODBC;DRIVER={%s};DSN='';DBQ=%s"),sDriver,sDatabase); try { m_pDatabase->Open(NULL,false,false,sDsn); } catch(CDBException* e) { e->GetErrorMessage(sError,100); AfxMessageBox(sError); } :confused:
-
Hi, can any body help me in creating a username and password for the database programmatically.I am connecting to the database like this: CString sDriver = "MICROSOFT ACCESS DRIVER (*.mdb)"; CString sDsn; TCHAR sError[100]; sDsn.Format(_T("ODBC;DRIVER={%s};DSN='';DBQ=%s"),sDriver,sDatabase); try { m_pDatabase->Open(NULL,false,false,sDsn); } catch(CDBException* e) { e->GetErrorMessage(sError,100); AfxMessageBox(sError); } :confused:
read msdn "SQLDriverConnect (Access)" there you will see, that the UID and PWD keywords are supported... use sDsn.Format(_T("ODBC;DRIVER={%s};DSN='';DBQ=%s;UID=%s;PWD=%s"),sDriver,sDatabase,sUser,sPass); i don't know if this works, it's just an idea. good luck Don't try it, just do it! ;-)