使用VBScript连接,插入,删除,在ms访问数据库中搜索 [英] connect,insert,delete,search in ms access database with VBScript

查看:54
本文介绍了使用VBScript连接,插入,删除,在ms访问数据库中搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我想知道如何连接到Ms-access数据库并使用VBScript对其进行插入,删除和搜索.

****请举例说明****

请帮助我

Hi I want know how do I connecting to Ms-access database and insert,delete,search into it with VBScript.

****please describe with an example****

Please help me

推荐答案

类似于上述READ操作概念,您可以扩展INSERT,DELETE和UPDATE操作.如果您有任何特定的查询,请告诉我们.
Similar to above READ operation concept, you can extend INSERT, DELETE and UPDATE operation. If you have any specific query, letz know.


示例代码读取操作:

Sample code Read operation:

<html>
<Title> Read MS Access using VBScript </Title>
<body>

<h2>Employee List, sorted by Employee ID.</h2><br>

<TABLE border="1">
   <TR>
      <TD><B>ID</a></B></TD>
      <TD><B>Name</a></B></TD>
   </TR>

<%
Set MyConn = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("Employee.mdb")
MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
SQL_query = "SELECT EmpID, EmpName "&_
               "FROM EmployeeTable "&_
               "ORDER BY ID;"
Set RS = MyConn.Execute(SQL_query)
WHILE NOT RS.EOF
%>

<TR>
   <TD><%=RS("EmpID")%></TD>
   <TD><%=RS("EmpName")%></TD>
</TR>

<%
RS.MoveNext
WEND
RS.Close
set RS = nothing
MyConn.close
set MyConn = nothing
%>

</TABLE>
</body>
</html>


这篇关于使用VBScript连接,插入,删除,在ms访问数据库中搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆