Run-time error '13': Type mismatch 
Author Message
 Run-time error '13': Type mismatch

Hello

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"
        myobject.Execute(query_next_mslink)

Documentation says:

        connection.Execute (CommandText, RecordsAffected, Options)

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

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

With best regards
Pawel
--
??? ? ?
--



Sun, 23 May 2004 16:28:27 GMT  
 Run-time error '13': Type mismatch


Hi Pawel

If you are returning records, as it appears, then you need to provide a
recordset to store the results

set myRecordset=myConnection.Execute("select mslink from sp_ad")

If your sql doesn't return records then you can just use

myConnection.Execute sql_string

Richard

Quote:
> Hello

> 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"
>         myobject.Execute(query_next_mslink)

> Documentation says:

>      connection.Execute (CommandText, RecordsAffected, Options)

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

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

> With best regards
> Pawel



Mon, 24 May 2004 00:08:17 GMT  
 Run-time error '13': Type mismatch

Quote:

>         query_next_mslink = "select mslink from sp_ad"
>         myobject.Execute(query_next_mslink)
> Documentation says:
>    connection.Execute (CommandText, RecordsAffected, Options)
> The last two parameters are optional and adding them gives the same
> error.

Strange to use a select method on Execute. Don't you want to open a
recordset insted with an ADO.Open method? I've found type mismatch
errors can occur when SQL bombs out on an ADO.Open method sometimes
(e.g. if the statement was invalid or didn't return anything). But
what I think is happening here is that this statement is returning a
recordset, where VB is expecting a simple status message.


Mon, 24 May 2004 00:40:17 GMT  
 Run-time error '13': Type mismatch
I may be off base on this, but the examples I've seen show this to
return a value back.

Perhaps you can try iRet = myObject.Execute("SELECT ....") ?

The TYPE certainly appears okay (i.e. String).

I'd give it a try just to eliminate that possibility.

Peace.

Rick

Quote:

> Hello

> 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"
>         myobject.Execute(query_next_mslink)

> Documentation says:

>    connection.Execute (CommandText, RecordsAffected, Options)

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

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

> With best regards
> Pawel



Mon, 24 May 2004 02:25:43 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ACC2000:Run Time Error '13': Type Mismatch

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

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

4. Run -time error '13' Type Mismatch

5. Urgent: runtime error '13' type mismatch

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

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

8. type mismatch error '13'????

9. runtimer error '13' type mismatch

10. Type Mismatch Run-Time error 13

11. Type mismatch, run-time error #13

 

 
Powered by phpBB® Forum Software