1
1001
Unregistered / Unconfirmed
GUEST, unregistred user!
Active dll(Project1.Connect)代码如下
Function OpenConnection(Cnn As ADODB.Connection) As Integer
Cnn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Northwind;Data Source=XXX"
Cnn.Open
End Function
用vb 调用
Dim gc As New Project1.Connect
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
a = gc.OpenConnection(cnn)
rs.ActiveConnection = cnn
rs.Open "products"
MsgBox rs("productname")
不出错
asp调用
set gc=Server.CreateObject("project1.Connect")
set cnn=Server.CreateObject("adodb.connection")
a = gc.OpenConnection(cnn)
出错
是不是asp不支持对象作为参数,谁碰到过这种问题吗?
Function OpenConnection(Cnn As ADODB.Connection) As Integer
Cnn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Northwind;Data Source=XXX"
Cnn.Open
End Function
用vb 调用
Dim gc As New Project1.Connect
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
a = gc.OpenConnection(cnn)
rs.ActiveConnection = cnn
rs.Open "products"
MsgBox rs("productname")
不出错
asp调用
set gc=Server.CreateObject("project1.Connect")
set cnn=Server.CreateObject("adodb.connection")
a = gc.OpenConnection(cnn)
出错
是不是asp不支持对象作为参数,谁碰到过这种问题吗?