Ok what I am trying to do is create a function within VB, The fucntion will pass along 2 variables as a string, One of them is to create the object connection and the other will be the object row after running the SQL Query, this is what I have....
Public Function RUNConnection(ObjectZ As String, ObjectRow as String)
GDz = ObjectZ
Rowz = ObjectRow
Connstr = "DSN=vslink;UID=blah;PWD=blah"
Set GDz = CreateObject("Adodb.Connection"
GDz.Open Connstr
SQLQ = "select * from developers;"
Set Rowz = GDz.Execute(SQLQ)
RUNConnection = Rowz
End Function
In a command button I have the following...
myconn = RUNConnection("gd", "gdzrow"
MsgBox gdzrow
The program works up to opening the DSN connection but after that I get the following error on this line:
myconn = RUNConnection("gd", "gdzrow"
Error: Wrong number of arguments or invalid property assignment, any ideas? Basically i want to return the row after the query has been sent. Thanks a lot. Gordon R. Durgha
gd@vslink.net
Public Function RUNConnection(ObjectZ As String, ObjectRow as String)
GDz = ObjectZ
Rowz = ObjectRow
Connstr = "DSN=vslink;UID=blah;PWD=blah"
Set GDz = CreateObject("Adodb.Connection"

GDz.Open Connstr
SQLQ = "select * from developers;"
Set Rowz = GDz.Execute(SQLQ)
RUNConnection = Rowz
End Function
In a command button I have the following...
myconn = RUNConnection("gd", "gdzrow"

MsgBox gdzrow
The program works up to opening the DSN connection but after that I get the following error on this line:
myconn = RUNConnection("gd", "gdzrow"

Error: Wrong number of arguments or invalid property assignment, any ideas? Basically i want to return the row after the query has been sent. Thanks a lot. Gordon R. Durgha
gd@vslink.net