我使用VBscript从SQL服务器中选择了数据(I have selected data from SQL server using VBscript)

编程入门 行业动态 更新时间:2024-10-14 08:30:10
我使用VBscript从SQL服务器中选择了数据(I have selected data from SQL server using VBscript)

我正在尝试使用vb脚本从数据库中获取数据。我有如下代码:

<FORM action="" method="post"> <!--#include file="open_conn.asp" --> <% 'Get id dynamique from id unsubcribe mail id = Request.QueryString("ID_unsub") 'Selection phone number SQL = "SELECT telephone FROM KS_enfants WHERE IDenfant=1" Set Retel = Server.CreateObject("ADODB.RecordSet") Server.ScriptTimeout=120 Retel.Open SQL,session("mycon"),1,1 '======================= Read data and sent================= Do While NOT Retel.Eof tel = Retel("telephone") Loop %> <table cellpadding="0" cellspacing="0" style="padding:0; background:#fff;"> <tr> <td colspan="2" style="height:auto;"> <input type="text" name="txt_num" id="txt_num" style="width:250px;" value="<% tel %>" /> </td> </tr> </table>

实际上,我收到了错误消息:

Erreur d'exécution Microsoft VBScript erreur '800a000d' Type incompatible: 'tel' /Emailing/template_email/emailing-apprenant/righ-side-1.asp, ligne 90

我不知道如何修理它。任何人都知道,请帮帮我,谢谢。

I'm trying to get data from database using vb script.I have the code as below:

<FORM action="" method="post"> <!--#include file="open_conn.asp" --> <% 'Get id dynamique from id unsubcribe mail id = Request.QueryString("ID_unsub") 'Selection phone number SQL = "SELECT telephone FROM KS_enfants WHERE IDenfant=1" Set Retel = Server.CreateObject("ADODB.RecordSet") Server.ScriptTimeout=120 Retel.Open SQL,session("mycon"),1,1 '======================= Read data and sent================= Do While NOT Retel.Eof tel = Retel("telephone") Loop %> <table cellpadding="0" cellspacing="0" style="padding:0; background:#fff;"> <tr> <td colspan="2" style="height:auto;"> <input type="text" name="txt_num" id="txt_num" style="width:250px;" value="<% tel %>" /> </td> </tr> </table>

In fact, I got the error messages:

Erreur d'exécution Microsoft VBScript erreur '800a000d' Type incompatible: 'tel' /Emailing/template_email/emailing-apprenant/righ-side-1.asp, ligne 90

I do not know how to fix it.Anyone know, help me please, Thanks.

最满意答案

我想而不是:

<% tel %>

你的意思是:

<%=tel %>

要么

<% Response.Write(tel) %>

I think instead of:

<% tel %>

You meant:

<%=tel %>

Or

<% Response.Write(tel) %>

更多推荐

本文发布于:2023-08-01 13:39:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1359263.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选择了   器中   数据   SQL   VBscript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!