ACCESS½¨±íÎÊÌâ
m_pConnect->BeginTrans();
strSql.Format("CREATE TABLE SysUser(lsh AUTOINCREMENT NOT NULL UNIQUE,PRIMARY KEY(lsh),userType BYTE)");
m_pConnect->Execute((_bstr_t)strSql,NULL, adExecuteNoRecords);
ÕâÑù½¨±í¾Í³É¹¦£¬
°ÑsqlÓï¾ä»»³É
strSql.Format("CREATE TABLE SysUser(lsh AUTOINCREMENT NOT NULL UNIQUE,PRIMARY KEY(lsh),UserID VARCHAR(50),UserName VARCHAR(50),Password VARCHAR(50),userType BYTE)");
m_pConnect->Execute((_bstr_t)strSql,NULL, adExecuteNoRecords);Ö´ÐоʹíÎóÁË ¡£¡£¡£
ÓôÃÆËÀÁË¡£
SQL code:
'AccessÖÐûÓÐvarcharÀàÐÍ£¬ÓÃTEXTÀàÐÍ´úÌæ¡£
CREATE TABLE SysUser(lsh AUTOINCREMENT NOT NULL UNIQUE,PRIMARY KEY(lsh),UserID TEXT,UserName TEXT,Password TEXT,userType BYTE
µ«ÊÇÄǸöÓï¾äÔÚaccessµÄ²éѯ£ºÊý×Ö¶¨Òå²éѯÀïÃæÊÇ¿ÉÒԳɹ¦´´½¨µÄ¡£
°ÑVARCHAR»»³ÉTEXTÒ²ÊÇͬÑùµÄ´íÎ󣬵±Óöµ½´íÎóʱ³ÌÐòÔËÐеÀ
inline _RecordsetPtr Connection15::Execute ( _bstr_t CommandText, VARIANT * RecordsAffected, long Options ) {
struct _Recordset * _result = 0;
HRESULT _hr = raw_Execute(CommandText, RecordsAffected, Options, &_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _RecordsetPtr(_result, false);
}----------------------------------------------------------------msado1
Ïà¹ØÎÊ´ð£º
ACCESSÖн¨Á¢Çл»±íµ¥,
µã»÷ ¹¤¾ß/×ÊÁϿ⹫ÓóÌʽ/Çл»±íµ¥¹ÜÀíÔ± ºó
Ìáʾ£ºMicrosoft office accessÎÞ·¨½¨Á¢visual basicÄ£×飡
µ½µ×ÊdzöÁËʲ÷áÎÊÌâÄØ£¿
µÚÒ»´ÎÕâÑù½¨Á¢Çл»±íµ¥ÊÇ¿ÉÒԵģ¬µ«ÊÇÓÉÓÚÓÐ ......
ÎÒÓÐÒ»¸öUnits±í,½á¹¹Îª:
ID UnistsName
UN1 ºÚÁú½¶«·½Ñ§Ôº
UN2   ......
sqlÓï¾äÊÇÕâÑùдµÃ
string sql = "select * from shophistory where username(stringÀàÐÍ)¡¡like '%"+ name +"%' ";
½á¹ûÔËÐб¨´í£º(²Ù×÷·û¶ªÊ§) ÔÚ²éѯ±í´ïʽ ˵ºó ......
ÔÚaccessÖÐÔõôִÐÐselect TOP (@size) * from table1
Õâ¸öTOPÔõô´ø²ÎÊý²éѯ°¡
ÓÃVBA¶¯Ì¬Éú³ÉSQLÓï¾ä£¬ÔÙÖ´ÐÐ
²»ÄÜÖ±½ÓÓÃSQLÓï¾ä£¬ÓÃ×Ö·û´®ÀÛ¼ÓÉú³ÉSQLÓï¾äµÄ·½·¨À´Ö´ÐÐSQLÓï¾ä
top n Õâ¸öûÓа취ʹÓò ......
¸øaccessÊý¾Ý¿â¼ÓÃܵIJ½ÖèÈçÏ£º
£¨1£©´ò¿ªaccessÈí¼þ£¬½çÃæÈçͼ1Ëùʾ
......