使用经典 ASP 仅更新 MS SQL 中的一个字段

发布于 2025-01-05 12:35:19 字数 696 浏览 0 评论 0原文

我一直在为这个脚本而苦恼,需要帮助。我正在尝试创建一个连接到以下 sql 字段的注册表单:Acct_ID用户名密码FirstName >、姓氏确认注册日期AccountNum

到目前为止,我所能做的是将表单插入到数据库中,并将 cdosys 电子邮件发送到电子邮件地址(用户名),并将查询字符串附加到嵌入在电子邮件中的链接中。查询字符串是注册表单中的 AccountNum 字段。

我想要尝试做的是仅在用户单击如下所示的链接时更新数据库中的确认字段: http://www.domainname.com/Presenter_Account_Confirm_Registration.asp?AccountNum=2152012319101300766363428210152260

我验证了帐号已转移到确认页面,但我对如何仅更新数据库中的确认字段感到困惑。任何帮助将不胜感激。谢谢你!

I have been banging my head with this script and need to assistance. I am trying to create a registration form that connects to the following sql fields: Acct_ID, Username, Password, FirstName, LastName, Confirmation, RegistrationDate and AccountNum.

What I have been able to do so far is get the form inserted into the database and have a cdosys email sent out to the email address(username) with a querystring attached to a link embedded in the email. The querystring is the AccountNum field from the registration form.

What I want to try to do is update the confirmation field only in the database when the user clicks on the link which looks like this:
http://www.domainname.com/Presenter_Account_Confirm_Registration.asp?AccountNum=2152012319101300766363428210152260.

I verified that the Account Number is transferred to the confirmation page, but I am stumped as to how to update just the confirmation field in the database. Any help would be greatly appreciated. Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟燃烟灭 2025-01-12 12:35:19

此处做出一些假设,Acct_IDINT,与 AccountNum 相同,并且您要设置 Confirmation 到 <代码>1:

<%
  Acct_ID = Request.QueryString("AccountNum")
  set cmd = CreateObject("ADODB.Command")
  cmd.ActiveConnection = conn ' assume ADODB.Connection has been set up
  cmd.CommandType = adCmdText
  sql = "UPDATE dbo.tablename SET Confirmation = 1 WHERE Acct_ID = ?"
  cmd.Parameters(0).value = Acct_ID
  cmd.CommandText = sql
  cmd.Execute
%>

Making some assumptions here, that Acct_ID is an INT, is the same as AccountNum, and that you want to set Confirmation to 1:

<%
  Acct_ID = Request.QueryString("AccountNum")
  set cmd = CreateObject("ADODB.Command")
  cmd.ActiveConnection = conn ' assume ADODB.Connection has been set up
  cmd.CommandType = adCmdText
  sql = "UPDATE dbo.tablename SET Confirmation = 1 WHERE Acct_ID = ?"
  cmd.Parameters(0).value = Acct_ID
  cmd.CommandText = sql
  cmd.Execute
%>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文