Function eud(AdminName,Name)
Dim Rs,List
eud = False
Set Rs = Server.CreateObject("ADODB.RecordSet")
Rs.Open "Select GID from Admin where Name='" & Replace(AdminName,"'","") & "'",Conn
if Not Rs.Eof then
if CStr(Rs("GID")) = "0" then
eud = True
else
List = GeteuList(AdminName)
if (List <> "") and (euName <> "") then
if InStr(List,euName) <> 0 then
eud = True
else
eud = False
end if
else
eud = False
end if
end if
else
eud = False
end if
End Function
里面有Set Rs = Server.CreateObject("ADODB.RecordSet")
VB怎么写啊? 我封装成DLL调用。
Dim Rs,List
eud = False
Set Rs = Server.CreateObject("ADODB.RecordSet")
Rs.Open "Select GID from Admin where Name='" & Replace(AdminName,"'","") & "'",Conn
if Not Rs.Eof then
if CStr(Rs("GID")) = "0" then
eud = True
else
List = GeteuList(AdminName)
if (List <> "") and (euName <> "") then
if InStr(List,euName) <> 0 then
eud = True
else
eud = False
end if
else
eud = False
end if
end if
else
eud = False
end if
End Function
里面有Set Rs = Server.CreateObject("ADODB.RecordSet")
VB怎么写啊? 我封装成DLL调用。
1)引用 ado 库,然后
dim rs as new adodb.recordset2)使用 createobject 语句
dim rs as object
set rs=createobject("adodb.recordset")
另外,注意你代码中的 conn,如果其它地方没有声明,这里也要声明
VB怎么写啊? 我封装成DLL调用。写成SET RS=New RecordSet
可以调用到吗?
DBPath = Server.MapPath("db1.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPathSet cc= Server.CreateObject("ggg1.ccc1")
response.write cc.eud(Session("Admin"),"0601")这样子的
.....end function我没这么做过,不能保证对象也能被正确传递,所以上面的方法可能有问题。
"Provider = Microsoft.Jet.OLEDB.4.0;Data Source = D:\database\db1.mdb"Connstr= 上面那段cc.GetC(Connstr)
以下是VB里
Public Function GetC(Connstr As String) As String在这里用conn.open Connstr 这样打开就不行了,提示类型不匹配: 'GetC'