What I am trying to do is return the objects 'cn' and 'rs' from the function below. This is what I have:
Function OpenRecordSet(cn_str, uid, pwd, sql)
Dim cn, rs, dbCollection()
CONST adOpenStatic = 3, adLockReadOnly = 1, adCmdText = &H0001
Set cn = CreateObject("ADODB.Connection")
cn.Open cn_str, uid, pwd
dbCollection(0) = cn
Set rs = CreateObject("ADODB.Recordset")
rs.Open sql, cn, adOpenStatic, adLockReadOnly, adCmdText
dbCollection9(1) = rs
OpenRecordSet = dbCollection
End Function
Thanks.
Function OpenRecordSet(cn_str, uid, pwd, sql)
Dim cn, rs, dbCollection()
CONST adOpenStatic = 3, adLockReadOnly = 1, adCmdText = &H0001
Set cn = CreateObject("ADODB.Connection")
cn.Open cn_str, uid, pwd
dbCollection(0) = cn
Set rs = CreateObject("ADODB.Recordset")
rs.Open sql, cn, adOpenStatic, adLockReadOnly, adCmdText
dbCollection9(1) = rs
OpenRecordSet = dbCollection
End Function
Thanks.