|
-
May 20th, 1999, 09:16 PM
#1
How to visit Dao which has a password?
I want to visit a Dao access,which has a password
and I know the password.How to write the open
dao code?
-
May 21st, 1999, 12:50 AM
#2
Re: How to visit Dao which has a password?
You can specify Your password while creating CDaoWorkspace object (use pWorkspace->Create ("MyWorkspace", "MyName", "MyPassword")). Then, You should use this opened workspace when you create the CDaoDatabase object (Use constructor of CDaoDatabase: CDaoDatabase (pWorkspace)).
-
May 22nd, 1999, 06:15 AM
#3
Re: How to visit Dao which has a password?
-
May 25th, 1999, 12:45 AM
#4
Re: How to visit Dao which has a password?
Or, if you don't need to create the db you don't even need a workspace object, just whack the connect string into the Open call.
e.g.
CString m_strPwd = ";pwd=BUTSO";
CDaoRecordset rs;
try
{
rs.Open("DBName" /* DAO will append .mdb */, TRUE /* Share Exclusive */, FALSE /* Read Only */, (LPCTSTR)m_strPwd /* Connect String */);
}
catch (CDaoException * e)
{
TRACE("Error: %s\r\n", e->m_pErrorInfo->m_strDescription);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|