2013-04-02 50 views
0

從SQL Server我選擇的數據我想用vb script.I有如下的代碼從數據庫中的數據:使用VBScript

<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 

我不知道如何解決它。任何人都知道,請幫助我,謝謝。

回答

0

我認爲不是:

<% tel %> 

您的意思是:

<%=tel %> 

或者

<% Response.Write(tel) %>