|
使用数据库取值函数GetAllData从数据库中读取登录数据,函数返回值是数组,那么在action中Username\Password是怎样调用函数返回值,请各位指点一下.GetAllData函数如下:
function GetAllData(columnname )
Dim ts, s,GetUserName,Table
Set con=createobject ("adodb.connection")
con.open "Driver=SQL Server;Server=192.168.111.123;UID=sa;PWD=autotdserver;APP=Quick Test Pro;DataBase=scenariote"
Set record=createobject("adodb.recordset")
sql="select * from QTPTraining"
record.open sql,con
i=0
Do while record(columnname)<>False
ReDim Preserve arr(i)
arr(i)=record(columnname)
record.movenext
if record.eof=true then
exit do
end if
i=i+1
loop
record.close
set record=nothing
con.close
set con=nothing
GetAllData=arr
end function |
|