VCÐÞ¸ÄAccessÃÜÂë
void ModifyDBCode()
{
CString strPath;
::GetModuleFileName(GetModuleHandle(NULL),strPath.GetBuffer(256),256);
strPath.ReleaseBuffer();
int flag=strPath.ReverseFind('\\');
int size=strPath.GetLength();
strPath.Delete(flag,size-flag);
strPath= strPath+ _T("\\test.mdb"); //Êý¾Ý¿âÃû³Æ
CString strConn=_T("Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=");
CString buf=strPath;
ASSERT(buf != _T(""));
strConn+=buf;
strConn+=_T(";Jet OLEDB:Database Password = ");
strConn+= g_strPassword;
strConn+=_T(";Mode=Share Deny Read|Share Deny Write"); // du zhan fang shi da kai
CADODatabase pAdoDb;
pAdoDb.SetConnectionString(strConn);
if(!pAdoDb.Open()) return;
CString strExe = _T("ALTER DATABASE PASSWORD [");
strExe += m_strNewCode;
strExe += _T("] [");
strExe += g_strPassword;
strExe += _T("]");
pAdoDb.Execute(strExe);
}
Ïà¹ØÎĵµ£º
SQLConfigDataSource
´´½¨ODBCÊý¾ÝÔ´¿ÉÒÔµ÷ÓÃWindowsϵͳ×ÓÄ¿
¼ÏµĶ¯Ì¬Á´½Ó¿âOdbcint.dllÖеĺ¯ÊýSQLConfigDataSource()
¸Ãº¯Êý¿ÉÒÔ¶¯Ì¬µØÔö¼Ó¡¢Ð޸ĺÍɾ³ý
Êý¾ÝÔ´¡£
SQLConfigDataSource()º¯Êý
SQLConfigDataSource()µÄÔÐÍÈçÏÂ:
BOOL SQLConfigDataSource(HWND hwndParent, UINT
fRequest ......
ÉÏÍøgoogleÁËһϣ¬¿´Á˼¸¸öÈ˵ÄÌû×Ó£¬´ó¸ÅÃ÷°×ÁËÊÇʲôÒâ˼¡£
Èç¹ûÒ»¸öÓû§µÄIPÔÚ×î½üÒ»¶Îʱ¼äÄÚ¶à´ÎÓÉÓÚÃÜÂë´íÎóµÇ¼ʧ°Ü£¬ÄÇôϵͳ¾Í»á°ÑÕâ¸öÓû§·âµô£¬submit»òÕßmail¾Í»áÌáʾAccess denied.
Õâ±¾ÊÇÒ»¸ö°²È«´ëÊ©£¬µ«ÊÇûÏëµ½poj¿ªÍ¨ËùνµÄ"¹«Íø¼ÓËÙ"Ö®º ......
ת×Ô
http://topic.csdn.net/t/20050110/09/3711952.html
accessÖÐʱ¼äÒªÓÃ#,²»ÊÇË«ÒýºÅ
select * from kc where rq < #2000-01-01# and rq>#2002-01-01#
²»ÒªÓÃbetween,ËüµÄЧÂÊÌ©µÍ
ʹÓÃ# ¶ø²»ÊÇ ......
ת×Ô
http://topic.csdn.net/t/20050110/09/3711952.html
accessÖÐʱ¼äÒªÓÃ#,²»ÊÇË«ÒýºÅ
select * from kc where rq < #2000-01-01# and rq>#2002-01-01#
²»ÒªÓÃbetween,ËüµÄЧÂÊÌ©µÍ
ʹÓÃ# ¶ø²»ÊÇ ......