连接数据库代码问题 帮我!!!马上送分 解决
利用cookies的用户名连接不了 急死我了
Username=request.cookies( "Username ")
set rs=server.createobject( "adodb.recordset ")
sql= "select * from users where UserName= "&Username
rs.open sql,conn,1,2
运行提示以下错误:(其中shagua是一个用户名)
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14 '
[Microsoft][ODBC SQL Server Driver][SQL Server]列名 'shagua ' 无效。
/user/save.asp,行 30
------解决方案--------------------Username=request.cookies( "Username ")
set rs=server.createobject( "adodb.recordset ")
sql= "select * from users where UserName= ' "&Username& " ' "
rs.open sql,conn,1,2
------解决方案--------------------少了个符号" '"
Username=request.cookies( "Username ")
set rs=server.createobject( "adodb.recordset ")
sql= "select * from users where UserName= ' "&Username& " ' "
rs.open sql,conn,1,2
------解决方案--------------------sql= "select * from users where UserName= ' " & Username & " ' "
rs.open sql,conn,1,1