Run-time error '13': Type mismatch

Run-time error '13': Type mismatch

Post by Pawel Hada » Thu, 06 Dec 2001 17:28:09


I have this kind of error while running the following code:

        myobject.Execute("select mslink from sp_ad")

Another way of running the code gives the same error:

        query_next_mslink = "select mslink from sp_ad"

Documentation says:

        connection.Execute (CommandText, RecordsAffected, Options)

The last two parameters are optional and adding them gives the same

If you have any ideas why it is so, please help me.

With best regards
??? ? ?


Run-time error '13': Type mismatch

Post by David Wimbu » Fri, 07 Dec 2001 19:24:56

Are you absolutely sure that myobject is a Connection object at this time?


1. Database retreival SQL image generates Run-Time error '13': type mismatch.


I have a problem.

background info:
Until now, we used a program which generates modified images and saves them
to disk, but this is getting a 'space-eating' process since my intanet uses
at the moment around 400 images per day typically. The images are previews
of pictures to be processed for the local paper.
The code below is used in an ActiveX DLL component which I'm developing in
VB5, later to be used in my ASP pages (the idea is to directly load an
image from SQL, draw a rectangle on it as a selection, and then show it in
a <IMG> tag). It is preferred not to save the image to disk.

The test code below retreives an image from SQL using ADO 1.5, and tries to
put it in the property Picture of a Picture Box, but it generates an error
Run-Time error '13': type mismatch.
This happens on the line "Picture1.Picture = rs("Preview")".

Private Sub Command1_Click()
    'get the image and CROP info from SQL

    Dim con As ADODB.Connection
    Dim rs As ADODB.Recordset
    Dim strQuery As String
    Dim Pict As Variant
    'Dim Pict As Byte

    'Open a connection without using a Data Source Name (DSN).
    Set con = New ADODB.Connection
    con.ConnectionString = "driver={SQL Server};" & _
    con.ConnectionTimeout = 30
    Set rs = New ADODB.Recordset
    strQuery = "SELECT Preview FROM Imagenes WHERE Folio=1301"
    rs.Open strQuery, con

    'Show the image
    Picture1.Picture = rs("Preview")


End Sub

I think it has something to do with type conversion, but I'm not sure.
Can anyone help me?

Thanx in advance, Pieter.

2. How make a backup of open bases on 8.0.x

3. Type MisMatch Error '13'

4. Modified Maintenance Plan

5. run time error type mismatch 13

6. Fix for clashing #defines of ERROR

7. "Run-time error 13: Type Mismatch"

8. Cachesize property of recordset.

9. Type Mismatch Runtime Error 13???

10. Mdac2.6 to Mdac2.7 causes Type Mismatch Runtime Error 13


12. "Runtime Error 13 Data Type mismatch"