简单的命令按钮问题 [英] simple command button question

查看:55
本文介绍了简单的命令按钮问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试创建一个简单的asp页面,其中有一个命令按钮

更新数据库。页面的URL如下所示:

http ://MyServer.com/Update.asp?UserName = Tom


我的asp代码是这样的:


% @语言= VBScript%>

<! - #include file =" includes / openconnection.asp" - >


StringUserName = Request.QueryString(" UserName")

StringSQL = UPDATE Users SET Current = 0 WHERE UserName =''" &

StringUserName& "''")


我需要构建命令按钮以便它显示在我的页面上然后

当用户点击时执行StringSQL按钮。我该怎么做?


谢谢,

Sam

Hi,
I am trying to create a simple asp page that has one command button that
updates a database. The URL of the page is like this:

http://MyServer.com/Update.asp?UserName=Tom

My asp code is like this:

%@ Language=VBScript %>
<!--#include file="includes/openconnection.asp"-->

StringUserName = Request.QueryString("UserName")

StringSQL = UPDATE Users SET Current = 0 WHERE UserName = ''" &
StringUserName & "''")

I need to build the command button so that it shows up on my page and then
execute StringSQL when the user clicks the button. How do I do this?

Thanks,
Sam

推荐答案

查看html表格

发布到另一个asp页面进行工作。


当你可以在html工作和发布时获取表格,然后才写下

asp页面来捕捉发布的内容(response.form或response.querystring)

然后用asp命中数据库

抱歉有点模糊 - 但这只是一个模糊的问题

Tim

" Samantha Smit" < SA ****** @ spamaway.cybermesa.com>在消息中写道

news:bl ********** @ reader2.nmix.net ...
look at html FORMs
post to another asp page to do the work.

when you can get the form in html working and posting, only then write the
asp page to capture what was posted (response.form or response.querystring)
and then with asp hit the database

sorry to be a bit vague - but it''s a but of a vague question
Tim
"Samantha Smit" <sa******@spamaway.cybermesa.com> wrote in message
news:bl**********@reader2.nmix.net...

我在尝试创建一个简单的asp页面,它有一个命令按钮来更新数据库。页面的URL如下所示:

http ://MyServer.com/Update.asp?UserName = Tom

我的asp代码是这样的:

%@ Language = VBScript%>
< ;! - #include file =" includes / openconnection.asp" - >

StringUserName = Request.QueryString(" UserName")

> StringSQL = UPDATE Users SET Current = 0 WHERE UserName =''" &
StringUserName& "''")

我需要构建命令按钮,以便它显示在我的页面上,然后在用户单击按钮时执行StringSQL。我该怎么做?

谢谢,
Sam
Hi,
I am trying to create a simple asp page that has one command button that
updates a database. The URL of the page is like this:

http://MyServer.com/Update.asp?UserName=Tom

My asp code is like this:

%@ Language=VBScript %>
<!--#include file="includes/openconnection.asp"-->

StringUserName = Request.QueryString("UserName")

StringSQL = UPDATE Users SET Current = 0 WHERE UserName = ''" &
StringUserName & "''")

I need to build the command button so that it shows up on my page and then
execute StringSQL when the user clicks the button. How do I do this?

Thanks,
Sam



你当然意识到你将设置你所有的当前如果UserName是Tom,那么
为0,对吗?


Page1.asp

< form method = get action = Page2.asp>

< input type = submit name =" UserName" value =" Tom">

< / form>

< a href =" Page2.asp?UserName = Tom">点击此处< / a>


Page2.asp是您提交的代码,加上行


connectionObject.Execute stringSQL


" Samantha Smit" < SA ****** @ spamaway.cybermesa.com>在消息中写道

news:bl ********** @ reader2.nmix.net ...
You realize of course that you will be setting all of your "Current" fields
to 0 if the UserName is Tom, right?

Page1.asp
<form method=get action=Page2.asp>
<input type=submit name="UserName" value="Tom">
</form>
<a href="Page2.asp?UserName=Tom">Click Here</a>

Page2.asp is the code you submitted, plus the line

connectionObject.Execute stringSQL

"Samantha Smit" <sa******@spamaway.cybermesa.com> wrote in message
news:bl**********@reader2.nmix.net...

我在尝试创建一个简单的asp页面,它有一个命令按钮来更新数据库。页面的URL如下所示:

http ://MyServer.com/Update.asp?UserName = Tom

我的asp代码是这样的:

%@ Language = VBScript%>
< ;! - #include file =" includes / openconnection.asp" - >

StringUserName = Request.QueryString(" UserName")

> StringSQL = UPDATE Users SET Current = 0 WHERE UserName =''" &
StringUserName& "''")

我需要构建命令按钮,以便它显示在我的页面上,然后在用户单击按钮时执行StringSQL。我该怎么做?

谢谢,
Sam
Hi,
I am trying to create a simple asp page that has one command button that
updates a database. The URL of the page is like this:

http://MyServer.com/Update.asp?UserName=Tom

My asp code is like this:

%@ Language=VBScript %>
<!--#include file="includes/openconnection.asp"-->

StringUserName = Request.QueryString("UserName")

StringSQL = UPDATE Users SET Current = 0 WHERE UserName = ''" &
StringUserName & "''")

I need to build the command button so that it shows up on my page and then
execute StringSQL when the user clicks the button. How do I do this?

Thanks,
Sam





汤姆B < SH ***** @ hotmail.com>在消息中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

"Tom B" <sh*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
你意识到当然,你将设置你所有的当前如果UserName是Tom,
字段为0,对吗?
You realize of course that you will be setting all of your "Current" fields to 0 if the UserName is Tom, right?




这不是目标吗?


雷在工作



Wouldn''t that be the goal?

Ray at work


这篇关于简单的命令按钮问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆