"Run-time error 13: Type Mismatch"

"Run-time error 13: Type Mismatch"

Post by theres » Thu, 10 May 2001 04:37:33



Hello,

I am trying to determine if a dataenvironment command executed successfully.  If
it did I want to save the selected SQL data into variables for use elsewhere in
my pgm.  If not, then i have to reset those same variables to nothing.  Here is
the code:

        Dim iTest As Variant

        iTest = deVMC_GTS.cmmFindLocationInfo(EquipLoc)
        If iResult = iSuccessful Then
            LocName = deVMC_GTS.rscmmFindLocationInfo!Loc_Name
            LocAddr1 = deVMC_GTS.rscmmFindLocationInfo!Loc_Addr1
            LocAddr2 = deVMC_GTS.rscmmFindLocationInfo!Loc_Addr2
            LocCity = deVMC_GTS.rscmmFindLocationInfo!Loc_City
            LocST = deVMC_GTS.rscmmFindLocationInfo!Loc_ST
            LocZip = deVMC_GTS.rscmmFindLocationInfo!Loc_Zip
        Else
            LocName = ""
            LocAddr1 = ""
            LocAddr2 = ""
            LocCity = ""
            LocST = ""
            LocZip = ""
        End If

Here is the stored procedure code that cmmFindLocationInfo executes:



        SELECT LOC_NAME, LOC_ADDR1, LOC_ADDR2, LOC_CITY, LOC_ST, LOC_ZIP
        FROM EQUIPLOC


                BEGIN


                END
        ELSE
                BEGIN


                END

deVMC_GTS.cmmFindLocationInfo's parameter properties settings are as follows:

         RETURN_VALUE  data type: adInteger   Host data type: Integer (VT_I2)  
         equip_loc     data type: adVarChar   Host data type: String (VT_BSTR)

I know that the equip_loc data types match up.  When I execute the command,
deVMC_GTS.cmmFindLocationInfo equip_loc, without trying to assign the result to
anything, it find the info I want.  The problem is when it doesn't find the info
I want.  In that case, when it goes to the next line of code to assign the
selected SQL data into variables it errs off because there is no data to be
assigned.  I really need to test to see if data was selected or not somehow.

Any help would be apreciated,

Thanks,
Theresa

 
 
 

1. "Runtime Error 13 Data Type mismatch"

I get this error from time to time when running my compiled VB app and my
app crashes.  I'm using VB 6.0,  SQLServr 2000,  MDAC 2.5 and who knows what
else.  I have error handlers in all my modules but this doesn't seem to be
trapped.  I use mainly stored procedures and I suspect it might have
something to do with errors generated by SQL that aren't handled by VB.  Can
anyone give me any advice here.  Upgrade to MDAC 2.6 or 2.7?

Thanks,
Tom H

2. ifx_get_blob... anyone can help me?

3. Run-time error '13': Type mismatch

4. D3 = add volume to d3

5. run time error type mismatch 13

6. DTS pVarPersistStgOfHost

7. Type Mismatch Runtime Error 13???

8. Hierarchical/network/OO dbms's

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

10. RUNTIME ERROR 13: TYPE MISMATCH

11. Handling "Type mismatch" error

12. Error 13: Type Mismatch error

13. Runtime Error 13 "type mismatch" while try to use opendatabase