dim databasename,conn,constr
databasename="data/#order.mdb"
Set conn=server.createobject("adodb.connection")
ConStr = "Driver={mysql odbc 3.51 driver};database=online_office;uid=root;pwd=123456;option=16386;Stmt=Set Names 'GBK'"
conn.open ConStr
function GetRsBySQLStr(var_sql)
set mrs = Server.CreateObject("ADODB.Recordset")
mrs.open var_sql,conn,1,3
set GetRsBySQLStr = mrs
end function
set rs=server.CreateObject("adodb.recordset")
sql="select * from aadmin where (id= " & id & ")"
set rs=GetRsBySQLStr(sql)
rs("username") = "username"
rs("password") = "password"
rs("sortid") = "1"
rs.update
rs.Close
set rs = Nothing
按理应该会更新 username 和password,isban,sortid字段,但我看数据库的查询记录如下:
186 Query UPDATE aadmin SET sortid=1 WHERE (id=4 AND sortid=1 AND username='ztd' AND password='dddd' AND name='何涛d' AND addtime='2007-05-03 10:56:53' )
实现上只更新了sortid一行,这是怎么回事?
表的结构:
--
-- 表的结构 `aadmin`
--
CREATE TABLE `aadmin` (
`id` int(11) NOT NULL auto_increment,
`sortid` smallint(6) default '0',
`username` varchar(50) default NULL,
`password` varchar(50) default NULL,
`name` varchar(50) default NULL,
`addtime` datetime default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=44 ;