首页 | 免费域名 | 个人服务器 | 一流信息监控拦截系统 | 虚拟主机知识库 | ASP 空间 | ASP技术大全 | 下载中心 | 客户服务中心
  7i24 > ASP技术大全 > ASP与数据库 > 数据库进阶与技巧 >
    7i24 .Com  
  asp 访问foxpro3.0的例子

7i24.Com不停为您服务


例子如下:(其中“zhxxdb”是一个foxpro数据源,指向被访问库所在的路径)
<% dim i,star,lend,tsql
 sql=request.querystring("q")
 if sql="" then
   sql=Session("query")
 end if
 Session("query")=sql
 for i=1 to len(sql)-4
   if mid(sql,i,4)="like" then
    star=i+5
    lend=i+6
    while mid(sql,lend,1)<>"'"
       lend=lend+1
    wend
    sql=left(sql,star-1)+"%"+mid(sql,star,lend-star)+"%"+mid 
      (sql,lend,len(sql)-lend+1)
   end if
 next
 set objdbconnection=server.createobject("ADODB.Connection")
 objdbconnection.open "zbxxdb"
 set zbxx=objdbconnection.execute(sql)
 if zbxx.bof and zbxx.eof then
   
   response.write "<strong>很抱歉,没有找到您所需要的数据!!
   </strong>
<p>"
   response.write"<a href='menuset.asp'> 单击这里返回上一页!
</a>
"
   response.write "<img src='http://101.101.101.219/sbzb/image/ds-
   boy.gif' tppabs='ds-boy.gif' width='48' height='48' alt='抱歉,
   抱 歉!!!'><p>
"
 else
   zbxx.movefirst



  2002年1月14日  阅读 1642 次  发送此页给朋友  来源:    版权争议  删除

相关文章:   近期热点:

上一篇: 获得字符串的真正长度
下一篇: Connection CommandTimeout和Command CommandTimeout的区别
返回上一层...
搜索:

(C)2004-2022 7i24.Com 保留所有权利