1. When connecting to an Access database with a password through ado, the following error is reported: "The workgroup information file is lost or has been opened exclusively by other users". For more information, see the information provided on the Internet, changed the connection string to "provider = Microsoft. jet. oledb.4.0; Data Source = database. MDB; persist Security info = false; Jet oledb: Database Password = 68984 ", but the database still cannot be connected. Later, I finally found myself adding myself. When the Database Password is specified in the connection string, the connection function does not need to provide the user name and password any more. // Set struid and strpwd to an empty string.
M_piconn-> open (_ bstr_t (strdb), _ bstr_t (struid), _ bstr_t (strpwd),-1 );
2. The database is connected, and the data query is successful. Even after the method is returned, a read/write conflict exception is thrown, and the exception is unknown, the error occurs in comip. A segment in H Code: Void _ release () Throw ()
{
If (m_pinterface! = NULL ){
M_pinterface-> release ();
}
} The _ recordsetptr and _ connectionptr com pointers both have the release method to release resources, at first, I thought I had an error releasing the resource when calling the release methods of the two pointers. Then I finally understood, originally, both com pointers use smart pointers encapsulated by _ com_smartptr_typedef. One feature of smart pointers is that resources can be automatically released. Now I understand, so I will cancel the place where the release method is explicitly called and let com manage resources by itself.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service