日期:2014-05-17  浏览次数:21432 次

多行查询如何把int型转成char型
我现在有一个多行的查询代码,能查数据库中int的代码
我现在相查char类型的数据但我不会改
谁帮我改一下,谢谢了
下面是通过id查德,我现在想通过名字查,在数据库中id是int的   名字是char的
源码是

<!--#include   file   = "conn.asp "-->
<%   Response.Buffer=True   %>

<%
id=request( "book_name ")
id   =   replace(id,chr(13), ", ")

Set   re   =   New   RegExp
re.Pattern   =   "[   \D]+ "
re.Global   =   True
re.IgnoreCase   =   True
re.MultiLine   =   True
id=re.replace(id, ", ")
Response.Write(id& " <br/> ")
id=split(id, ", ")
dim   newarr(),n
id_count=ubound(id)
n=0
redim   newarr(id_count)
for   i=0   to   id_count
      if   id(i) <> " "   then
          newarr(n)=id(i)
  n=n+1
      end   if
next
for   i=0   to   n-1
if   i <n-1   then
id2=id2&newarr(i)& ", "
else
id2=id2&newarr(i)
end   if
next

if   id2= " "   then
response.write   " <script   language=JavaScript> alert( '请输入关键字 '); "   &   "history.back() "   &   " </script> "  
Response.End()
end   if

set   rs=   server.createobject( "adodb.recordset ")
if   xuanxiang=0   then
sql=   "select   *   from   book   where   id   in   ( "&   id2   & ") "
end   if

if   rs.bof   or   rs.eof   then
      response.write " <SCRIPT   language=JavaScript> alert( '没有要查找的内容,请重新输入! '); "   &   "history.back() "   &   " </script> "  
            end   if  
%>

<tr>
        <td   height= "41 "   colspan= "7 "   align= "center "   valign= "top "> <table   width= "100% "   border= "0 ">
                <tr>
                    <th   width= "20% "   align= "left "   scope= "col "> <span   class= "STYLE4 "> 书名 </span> </th>
                   
                    <th   width= "21% "   align= "left "   scope= "col "> <span   class= "STYLE5 "> 作者名 </span> </th>
                    <th   width= "23% "   align= "left "   scope= "col "> <span   class= "STYLE5 "> 更新日期 </span> </th>
                </tr>
<%do   while   not   rs.eof%>
                <tr>
              &nbs