CNET中国旗舰网站

ZDNet China | CNET科技资讯网 | 政府采购 | 行业网站联盟





 
标题: [讨论] 连接数据库后为什么返回null值?
饼饼
金牌会员
Rank: 6Rank: 6



UID 307635
精华 1
积分 3495
帖子 383
威望 1584
ZD币 479 元
阅读权限 110
注册 2008-3-14
状态 离线
  楼主
发表于 2008-4-17 14:34  资料  个人空间  短消息  加为好友 
开发者在线

连接数据库后为什么返回null值?

连接数据库后为什么返回null值,测试数据库查询没有问题。请帮忙看一下是哪的问题。如果是异步的问题,请问应该如何设置引擎?   
  谢谢了。   
  <script   language   =   "javascript">   
  var   request   =   false;   
                          try   {   
                          request   =   new   XMLHttpRequest();   
                          }   catch   (trymicrosoft)   {   
                          try   {   
                          request   =   new   ActiveXObject("Msxml2.XMLHTTP");   
                          }   catch   (othermicrosoft)   {   
                          try   {   
                          request   =   new   ActiveXObject("Microsoft.XMLHTTP");   
                          }   catch   (failed)   {   
                          request   =   false;   
                          }   
                          }   
                          }   
                          if   (!request)   
                          alert("Error   initializing   XMLHttpRequest!");   
   
                          function   add()   {   
               
                          request.open("GET",   "http://localhost/spKey/EuKey.aspx",   true);   
                          request.onreadystatechange   =   processRequest;   
                          request.send(null);   
                          }   
   
      function   processRequest(){   
   
                          if   (request.readyState   ==   4){   
                          if   (request.status   ==   200){   
   
                                  var   kk   =EuKey.ServerSideAdd("slect   *   from   a");   
                document.Form1.txt3.value   =kk.value;   
    }   else   
                          alert("status   is   "   +   request.status);   
                          }   
   
    }   
   
  服务器端:   
  VB:   
  <Ajax.AjaxMethod()>   _   
          Public   Function   ServerSideAdd(ByVal   str   As   String)   As   String   
                  ...连接数据库并返回值   
                  Dim   ss   As   String=   返回的值   
                  Return   ss   
   
          End   Function




顶部
 



当前时区 GMT+8, 现在时间是 2009-7-5 09:17

  Powered by Discuz! 5.5.0 © 2001-2007 Comsenz Inc.
Processed in 0.059888 second(s), 3/3 queries

清除 Cookies - 联系我们 - ZDNetChina中文社区 - 无图版