帮忙看下,下面的sql语句

来源:百度知道 编辑:UC知道 时间:2024/05/21 16:40:43
SQLStr="Update EnterpriseBody Set Enable="&Enable&" where ID=3927"

我修改当前行=3927的Enable的值。这个是可以的,我现在想如果ID=“我选取当前行”,该怎么写?
SQLStr="Update EnterpriseBody Set Enable="&Enable&" where ID="& ID"
我写的这个不能运行,大家帮忙下,在线!
Vlians:我用了你的,修改数据库不能成功!
下面是我的修改页面。看看哪有错?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--#include file="dbConnection.asp" -->
<!--#include file="SiteFunction.asp" -->
<%
ID=request("ID")
Set rs=Server.CreateObject("ADODB.RecordSet")
'接收数据,并处理数据格式;
EnterpriseName="'"&tosql(request.Form("EnterpriseName"))&"'"

SQLStr="Update EnterpriseBody Set Enable="&Enable&" where ID="& ID"

改为下面的
SQLStr="Update EnterpriseBody Set Enable="&Enable&" where ID="& ID

SQLStr="Update EnterpriseBody Set Enable="&Enable&" where ID="& ID&""

楼上回答的没啥变化啊。这样
SQLStr="Update EnterpriseBody Set Enable="&Enable&" where ID="@ID"
然后下面用parameter加上值就行了。