新建表:首先打开或新建一个数据库,在该数据库上使用CDaoTa笑系抓否算秋罗讲团bleDef的构赵函数定义一个对象,在调用Create函数360问答建新表,之后调用Append函数加入数据息缩考供题库:
12345678910111213141516171819202122232425262728293031323334353637383940414243void ChangeUserPassword( ){ CString strSystemDB = _优T( "路径" ); SetSystemDB( strSystemDB ); // User name and password manually added /风更聚包/ by using Microsoft Access CString strUserName = _T( "NewUser" ); CString strOldPassword = _T( "Password" ); CString strNewPassword = _T( "NewPassword" ); SetDefaultUser( strUser带何往镇做Name, strOldPassword ); ChangePassw伤名物副边儿观吧及月ord( strUserName, strOldPassword, strNewPassword ); }//设态跟增早正置默认用户和密码void SetDefaultUser整评执克危速南错样(CString & strUserName, CS乐肥当怎附省出课行tring & strPassword){ COleVariant varUse种但呼rName( strUserName, VT_BSTRT ); COleVariant varPassword( strPassword, VT_BSTRT ); DAODBEngine* pDBEngine = A伟态龙又变影如念着台进fxDaoGetEngine( ); A答征SSERT( pDBEngine != NULL ); // 设置默认用户 DAO_CHECK( pDBE晚仅啊亚亮祖穿ngine->put_DefaultUse用达冲维政呀谁巴r( varUserName.bstrVal ) ); // 设置默认密码 DAO_CHEC蒸精入距按调金低同影苦K( pDBEngine->put_DefaultPassword( varPassw苦府查伤课村她挥度福京ord.bstrVal ) )离游家便伯玉正束限超初;}///更改密码void SetDBPassword( LPCTSTR pDB, LPCTSTR pszOldPassword, LPCTSTR pszNewPassword ){ CDaoDatabase db; CString strConnect( _T( ";pwd=" ) ); // 数据库必须打开 // 设置密码 ***.open( pDB, TRUE, FALSE, strConnect + pszOldPassword ); COleVariant NewPassword( pszNewPassword, VT_BSTRT ), OldPassword( pszOldPassword, VT_BSTRT ); DAO_CHECK( db.m_pDAODatabase->NewPassword( V_BSTR( &OldPassword ), V_BSTR( &NewPassword ) ) ); db.Close();}标签:自宁,mdb,数据库
版权声明:文章由 神舟问 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.shenzhouwen.com/life/312471.html