Results 1 to 4 of 4

Thread: [RESOLVED] VB6 Compare pictures stored in two DBs

Threaded View

  1. #1

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Resolved [RESOLVED] VB6 Compare pictures stored in two DBs

    I'm writing a DB import function in VB6 with an Access 2000 DB.
    I need to test images stored in the two DBs to see if they are the same.
    They are stored using RhinoBull's method.
    I tried the following code, but I get a 'Type mismatch' error.

    Code:
    Private Function PictureMatch(ByRef OrgID As Long, ByRef ImprtID As Long) As Boolean
        Dim rsO As ADODB.Recordset
        Dim rsI As ADODB.Recordset
        Dim sSQL As String
        
        If OrgID = 0 Or ImprtID = 0 Then
            PictureMatch = OrgID = ImprtID
            Exit Function
        End If
        Set rsO = New ADODB.Recordset
        Set rsI = New ADODB.Recordset
        sSQL = "SELECT * FROM tblPics WHERE PicID = " & CStr(OrgID)
        rsO.Open sSQL, cn, adOpenStatic, adLockOptimistic, adCmdText
        If Not rsO.EOF Then
            sSQL = "SELECT * FROM tblPics WHERE PicID = " & CStr(ImprtID)
            rsI.Open sSQL, cn2, adOpenStatic, adLockOptimistic, adCmdText
            If Not rsI.EOF Then
                PictureMatch = rsI.Fields("Image") = rsO.Fields("Image")
            End If
            rsI.Close
            Set rsI = Nothing
        End If
        rsO.Close
        Set rsO = Nothing
    End Function
    Last edited by longwolf; Oct 14th, 2008 at 02:01 AM.

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