Results 1 to 3 of 3

Thread: Need MAJOR help !!!

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Red face Need MAJOR help !!!

    Ok I have this dll where I am trying to establish a db connection in class module Connection. Then I create a RS with class module RS.

    In the client App I use the following code. I am trying to pass the connection object between the 2 class modules in the dll. I get an error saying type mismatch where the red is. I AM ULTIMATELY TRYING TO TEST IF RS IS FILLED OR NOT.

    Can anyone help me please?
    Thanks

    Code:
    'THE CLIENT APP
    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
    
    conn.GetConn2
    
    If rs.Get_Search_RS(conn, 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
    Code:
    'CONNECTION CLASS
    Option Explicit
    Public conn2 As ADODB.Connection
    Public Sub GetConn2()
        Set conn = New ADODB.Connection
        conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Sms001\Shared\web\Internet\Graphic_Search\dbGraphics.mdb;Persist Security Info=False"
        conn.CursorLocation = adUseClient
        conn.Open
            
    End Sub
    
    'RS CLASS
    Option Explicit
    Public conn As ADODB.Connection
    Public rs As ADODB.Recordset
    Public sql As String
    Public lngCount As Long
    
    Public Function Get_Search_RS(conn As ADODB.Connection, rsRecordset As ADODB.Recordset, strTitle As String, strCat As String, strFileX As String, strFileName As String) As String
           Set rs = New ADODB.Recordset
    
           sql = "SELECT * FROM Master WHERE Master.Title LIKE '%" & strTitle & "%' and Master.Cat LIKE '%" & strCat & "%' and Master.FileExtension LIKE '%" & strFileX & "%' and Master.FileName LIKE '%" & strFileName & "%' ORDER BY FileName"
                   
           rs.Open sql, conn, adOpenStatic, adLockOptimistic
           
           Set rsRecordset = rs
           
           If rs.EOF Then
                Get_Search_RS = 1
           Else
                Get_Search_RS = 0
           End If
    End Function

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Yeah,
    the problem is that you don't know how to program!

    What do you think a type mismatch is?

    what type is 1?
    what type are you returning from your function?


    this was mentioned in yesterday's thread
    why don't you take advice/read replies properly??
    Mark
    -------------------

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    You really are rude and it seems that you forget that we all started somewhere and were not born with the skill to program. Please do not answer my threads anymore.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width