如何判断一个ACCESS库中是否含有某个表?

zuixin 2003-04-02 12:41:46
比如我要判断test.mdb中是否含有a1表,这个用asp怎么实现?
...全文
26 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluesky1314520 2003-04-13
  • 打赏
  • 举报
回复
Dim strCnn
strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("question.mdb")
Dim cnn
Set Cnn = Server.CreateObject("ADODB.Connection")
Cnn.ConnectionString = strCnn
Cnn.open
dim rs
Set rs = Cnn.openschema(20)
Dim strSQL
while not rs.eof
if lcase(rs("TABLE_NAME"))="normal" then response.write("此表存在")
rs.movenext
wend
try……
zuixin 2003-04-13
  • 打赏
  • 举报
回复
我这样写错在哪里?
Dim strCnn
strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("question.mdb")
Dim cnn
Set Cnn = Server.CreateObject("ADODB.Connection")
Cnn.ConnectionString = strCnn
Cnn.open
dim rs
Set rs = Server.CreateObject("ADODB.RecordSet")
Dim strSQL
while not rs.eof
if rs("TABLE_NAME")='normal' then response.write("此保存在")
rs.movenext
wend

gengwei80 2003-04-02
  • 打赏
  • 举报
回复
up
BLACKINEYE 2003-04-02
  • 打赏
  • 举报
回复
strcnn="driver= 省略
set objcnn=server.createobject("adodb.connection")
objcnn.open strcnn
set rsschema=objcnn.openschema(20)
while not rsschema.eof
if rsschema("TABLE_NAME")='a1' then response.write("此保存在")
rsschema.movenext
wend

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧