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);
}
Ïà¹ØÎĵµ£º
ACCESSÖÐÖظ´ÐеĴ¦Àí
ACCESSÖУ¬Ê¹ÓÃdistinctºÍgroup byºó£¬Èç¹ûÔÚjavaÖÐʹÓÃrs.next()µÄ»°£¬¾Í»áÌáʾ“ÎÞЧµÄÓαꔴíÎó¡£
µ«ÊÇ£¬²¢·Ç²»Ö§³ÖÉÏÃæÁ½¸öÓï·¨¡£
ËùÒÔ£¬¿ÉÒÔͨ¹ýÒÔÏÂÓï·¨½øÐжþ´Î²éѯ£¬½«Öظ´Êý¾ÝÈ¥µô¡£
select stockName from (select stockName from stock group by stockName) order by stock ......
//¸ù¾ÝÖ÷¼üÀ´É¾³ý±íÖеÄÊý¾Ý¡£
//ɾ³ý
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
OleDbConnection sqlConnection = new OleDbConnection(GetConnection());
& ......
ÓÉÓÚ³ÌÐòÐèÒª°ÑSQL SERVER ÀïµÄÊý¾Ýµ¼Èëµ½ACCESSÀï.
¸Õ¿ªÊ¼Ê¹ÓÃDataSetÀ´Ñ»·.
Êý¾ÝÁ¿ÉÙµÄʱºò»¹Ëã¿ÉÒÔÓ¦¸¶µÄ¹ýÀ´.
µ«µ±Êý¾Ý¶àµÄʱºò.
»á±¨´í"λÖôíÎó"
ÔÚÍøÉÏËÑÑ°Ò»·¬.ÕÒµ½Ò»¸ö·½·¨.
ʹÓÃinsert into openrowset
½Ó×Å´íÎóÒ»¸ö½ÓÒ»¸öµÄÀ´..
"²åÈë´íÎó: ÁÐÃû»òËùÌṩֵµÄÊýÄ¿Óë±í¶¨Ò岻ƥÅä¡£"
"δÄÜÕÒµ½ OLE DB Ì ......
Ò»:
1 ÃÜÂëÊÇÊý¾Ý¿âÃÜÂ룺
ÉèÖÃÊý¾Ý¿âÃÜÂ룬´ò¿ªÃÜÂëΪ555´ò¿ªÊ±ÐèҪʹÓÃ
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\1.mdb;User ID=admin;Password=;Jet OLEDB:Database Password=555"
2 Óû§×飺
Óû§ÃûΪ admin ÃÜÂëΪ rr Óû§×éÎļþΪ c:\system.mdw£¬´ò¿ªÊ±ÐèҪʹÓÃ
"Provider=Microsoft.Jet.OLEDB.4.0 ......
²éѯÓï¾äÖ»ÒªÕâÑùд,¾Í¿ÉÒÔËæ»úÈ¡³ö¼Ç¼ÁË
SQL="Select top 6 * from Dv_bbs1 where isbest = 1 and layer = 1 order by newID() desc"
ÔÚACCESSÀï
SELECT top 15 id from tablename order by rnd(id)
SQL Server£º
Select TOP N * from TABLE Order By NewID()
Access£º
Select TOP N * from TABLE Order By Rnd(ID ......