set con=createobject("adodb.connection")
con.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\test.mdb"
set rs=createobject("adodb.recordset")
sql="select * from tblcustomer where Acctnum='&isAccount'"
rs.open sql,con
If ( Not Rs.eof ) then
Rs.MoveFirst
msgbox("The Account Number " &Rs(0)&" is added successfull")
else msgbox("The account is not find")
End If
rs.close
set rs=nothing
con.close
set con=nothing作者: 美杜莎的瞳孔 时间: 2007-12-21 15:32
首先是在odbc数据源的系统数据源里添加了所要的access数据库。然后在qtp的datatable里点右键-〉sheet->import->from database,在弹出的菜单中选第二项,然后下一步,点create,找到那个access数据库,并在下面的输入框中输入相应的按列查询的access命令