ÔÚÒ»ÕÅaccess±íÖÐǶÌײéѯ
strSQLCmd.Format(_T("select * from (select * from talk_info where %s ='%s') where %s ='%s'"),
strVar,strValue,strVar2,strValue2);
ÇëÎÊÕâÓï¾äÓÐÎÊÌâÂð
ûÓÐÎÊÌâ¡£
½¨ÒéÄãͨ¹ýµ÷ÊÔ°ÑÕâ¸ö ("select * from (select * from talk_info where %s ='%s') where %s ='%s'"),strVar,strValue,strVar2,strValue2)
Êä³ö¿´Ò»Ï½á¹ûÊÇʲô£¿ ¹À¼ÆÄãµÄ±äÁ¿ÓÐÎÊÌâ¡£
strSQLCmdÄÚÈÝÊÇʲô
CString strSQLCmd;
ÊDz»ÊDZäÁ¿µÄÖµ´ú½øÈ¥ÊÇÕâÖÐÐÎʽ°¡£ºstrSQLCmd.Format(_T("select * from (select * from talk_info where strVar ='strValue') where strVar2 ='strValue2'")£»
Ïà¹ØÎÊ´ð£º
ÎÒÏëÔÚaspÖУ¬ÊµÏÖ°Ñ£¬±í1,±í2£¬±í3£¬Öеö×ֶΣ¬²éѯ³öÀ´£¬¾ÍÊÇÈý¸ö±íÁªºÏ²éѯ£¨ÎÒÓõÄʱºòÁ½¸ö±íÁªºÏ²éѯûÓÐÎÊÌ⣬µ«ÊǾÍÊDz»ÄÜÈý¸ö±íÁªºÏ²éѯ£©£¬
ÆäÖУ¬±í2µÄ£¬mainid,×ֶκͱí1µÄid×Ö¶ÎÏà¹Ø£¬±í2µÄid×Ö¶ ......
IsSqlDataBase = 0 'Ö÷Êý¾Ý¿âÀàÐÍ(1=SQL£¬0=AC)
'===========================================================================
SqlDatabaseName = "ads365" 'Ö÷Êý¾Ý¿âÃû
S ......
³ÌÐòʱASP+access
sql="select top 2 id,username from comp order by rnd(id) "
ÉÏÃæÓï¾äˢкó¶¼ÊÇÒ»¸öÖµ ÕâÑù»¹ÓÐËæ»úµÄÒâÒåÂð
ACCESSÓÐË¢ÐÂËæ»úÑ¡ÔñµÄSQLÓ ......
ÓÃVBÇóACCESSÁ½¸ö±íµÄºÍ
a±íÀïÓÐ
ID Ãû³Æ ÊýÁ¿ ×ܼÛ
1 a 13 11
2 c 20 20
3 c 2 52
4 b&nb ......