asp update 代码

·

<%
dim up_name
up_name=request.Form("up_name")
dim up_word
up_word=CInt(request.Form("up_word"))

Set Command1 = Server.CreateObject ("ADODB.Command")
Command1.ActiveConnection = MM_net_STRING
Command1.CommandText = "UPDATE g_main  SET g_type ="&up_word&" WHERE  g_name like ‘%"&up_name&"%’"
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

%>

关注这里up_word是数字类型。还有一个where的like

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注