|
-
May 2nd, 2001, 01:00 PM
#1
Thread Starter
PowerPoster
Dll returned a Rs. Now what?
My Dll returns me a recordset in the form of a variable. How do I now use the records from the rs to populate my listview? Is there a special way to declare a variable to be a rs?
Code:
Private Sub Command1_Click()
Dim rs As GRSrch.rs
Set rs = New GRSrch.rs
Dim conn As GRSrch.Connection
Set conn = New GRSrch.Connection
Dim rsRecordset As Recordset
conn.GetConn2
If rs.Get_Search_RS(rsRecordset, Text1.Text, Text2.Text, Text3.Text, Text4.Text) = 1 Then
MsgBox "No record found"
Else
MsgBox "record found"
End If
conn.CloseConn
End Sub
-
May 2nd, 2001, 01:07 PM
#2
PowerPoster
For example:
Code:
Option Explicit
m_objRS as ADODB.Recordset
'// All I am doing is passing my connection object to my class
'// Method and setting a recorset object to the return value.
Set m_objRS = objSelect.GetAllStates(m_objConn)
-
May 2nd, 2001, 01:33 PM
#3
Thread Starter
PowerPoster
I get an error because my arguments are not optional. I didn't think of that when I built the function.
Any ideas?
Code:
Private Sub Command1_Click()
Dim rs As GRSrch.rs
Set rs = New GRSrch.rs
Dim conn As GRSrch.Connection
Set conn = New GRSrch.Connection
Dim rsRecordset As ADODB.Recordset
Dim rsReturnRS As ADODB.Recordset
conn.GetConn2
If rs.Get_Search_RS(rsRecordset, Text1.Text, Text2.Text, Text3.Text, Text4.Text) = 1 Then
' sMsgBox "No record found"
Else
Set rsRecordset = rs.Get_Search_RS(rsReturnRS)
MsgBox "record found"
End If
conn.CloseConn
End Sub
-
May 2nd, 2001, 01:35 PM
#4
PowerPoster
You should be passing a connection object, not a recordset object.
-
May 2nd, 2001, 01:37 PM
#5
Thread Starter
PowerPoster
forgive me for my ignorance but I dealt with the conn object in the dll already by declaring it in a standard module.
All I want is the rs to use to populate a control.
-
May 2nd, 2001, 01:50 PM
#6
Thread Starter
PowerPoster
ok I passed the connection object but I still get an error saying Type mismatch on the red. I changed the dll to accept the conn object. But what does that do?
Code:
Option Explicit
Private Sub Command1_Click()
Dim rs As GRSrch.rs
Set rs = New GRSrch.rs
Dim conn As GRSrch.Connection
Set conn = New GRSrch.Connection
Dim rsRecordset As ADODB.Recordset
Dim rsReturnRS As ADODB.Recordset
conn.GetConn2
If rs.Get_Search_RS(conn.conn2, Text1.Text, Text2.Text, Text3.Text, Text4.Text) = 1 Then
MsgBox "No record found"
Else
Set rsRecordset = rs.Get_Search_RS (conn.conn2, Text1.Text, Text2.Text, Text3.Text, Text4.Text)
MsgBox "record found"
End If
conn.CloseConn
End Sub
Last edited by jesus4u; May 2nd, 2001 at 01:56 PM.
-
May 2nd, 2001, 02:03 PM
#7
Thread Starter
PowerPoster
changed the client and dll to reflect a return rs
Code:
If rs.Get_Search_RS(conn.conn2, rsReturnRS, Text1.Text, Text2.Text, Text3.Text, Text4.Text) = 1 Then
MsgBox "No record found"
Else
Set rsRecordset = rs.Get_Search_RS(conn.conn2, rsReturnRS, Text1.Text, Text2.Text, Text3.Text, Text4.Text)
MsgBox "record found"
End If
Still the same error as before.
I guess I don't underastand how to pass variables and retrieve them properly.
ugh!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|