Error 13, Type mismatch...sometimes

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

Hi,

I have two problems that I hope will share the same cause.

First when the user enters data, (via our VB6 application), we sometimes get
an error 13, "type mismatch" message box.
but more worryingly the application sometimes hangs, (and we then have to
restart it).

I suspect it could have something to do with the version of the ODBC DLL,
(where can I check what the version is?)
They are still using WindowsNT 4, where could I download the latest
installation package for MS Access ODBC that would work on WinNT?

So my questions are...

1- Where can I log, or see if MS Access is in fact no longer responding?
2- Can anything I do really cause MS Access to stop responding?
3- What typically cause the messages, error 13 or what ever?
4- Could a MS Access message waiting to be handled give the appearance that
the application has stopped responding?
and ...
5- How can I stop MS Access from giving messages and rather return the
message to my application so that I can handle it myself.
I don't want MS Access to popup with message boxes, I want to handle them
myself.

Many thanks for your help.

Simon
 
Simon said:
Hi,

I have two problems that I hope will share the same cause.

First when the user enters data, (via our VB6 application), we sometimes get
an error 13, "type mismatch" message box.
but more worryingly the application sometimes hangs, (and we then have to
restart it).

I suspect it could have something to do with the version of the ODBC DLL,
(where can I check what the version is?)
They are still using WindowsNT 4, where could I download the latest
installation package for MS Access ODBC that would work on WinNT?

So my questions are...

1- Where can I log, or see if MS Access is in fact no longer responding?
2- Can anything I do really cause MS Access to stop responding?
3- What typically cause the messages, error 13 or what ever?
4- Could a MS Access message waiting to be handled give the appearance that
the application has stopped responding?
and ...
5- How can I stop MS Access from giving messages and rather return the
message to my application so that I can handle it myself.
I don't want MS Access to popup with message boxes, I want to handle them
myself.

Many thanks for your help.

Simon

If you are connecting to an Access (Jet) database (i.e. an MDB file) from
VB6 using ODBC, there is no Access process involved. Access is simply(!) a
program that knows how to use the data stored in a Jet (MDB) database file.
You have got your own application to do that, written in VB6, so you are not
using Access.

1. You are not using MS Access. The "hang" is occurring in your
application somewhere (quite possibly in the ODBC library, as you suspect).
2. You are not using MS Access.
3. Typically you are trying to perform a numeric operation on text data,
or vice versa. If you posted your code or your SQL and some information
about the tables you are using then it should be pretty easy to spot.
4. No. You are not using MS Access.
5. The error isn't coming from MS Access, because you are not using MS
Access. The error is arising in your application, and you can trap/handle
it using the usual VB6 error handling.

To get fully up-to-date with all Microsoft Jet, ODBC and OLE-DB components,
download and install the appropriate updates from these pages (watch out for
line wraps in your news reader):

http://www.microsoft.com/downloads/...6c-8cdd-4168-a030-46f815d3f5cd&DisplayLang=en
http://www.microsoft.com/downloads/...95-efc2-4f8e-a9e0-3a1afbd5922e&DisplayLang=en
 
From Baz :
If you are connecting to an Access (Jet) database (i.e. an MDB file) from
VB6 using ODBC, there is no Access process involved. Access is simply(!) a
program that knows how to use the data stored in a Jet (MDB) database file.
You have got your own application to do that, written in VB6, so you are not
using Access.

1. You are not using MS Access. The "hang" is occurring in your
application somewhere (quite possibly in the ODBC library, as you suspect).
2. You are not using MS Access.
3. Typically you are trying to perform a numeric operation on text data,
or vice versa. If you posted your code or your SQL and some information
about the tables you are using then it should be pretty easy to spot.
4. No. You are not using MS Access.
5. The error isn't coming from MS Access, because you are not using MS
Access. The error is arising in your application, and you can trap/handle
it using the usual VB6 error handling.

To get fully up-to-date with all Microsoft Jet, ODBC and OLE-DB components,
download and install the appropriate updates from these pages (watch out for
line wraps in your news reader):

http://www.microsoft.com/downloads/...6c-8cdd-4168-a030-46f815d3f5cd&DisplayLang=en
http://www.microsoft.com/downloads/...95-efc2-4f8e-a9e0-3a1afbd5922e&DisplayLang=en

Well, the user is entering data according to the message. So my guess
for question 2 is that the code somewhere 'does' something with the
entered value and then errors because it's trying to add "apples" to 2
(or something like that).

As for the rest, start by setting up some error-handling in your code
(On Error GoTo <some function that reports the error to the screen and
then terminates nicely by closing all opened instances, etc.>

For ODBC, look at the MDAC package on
http://msdn.microsoft.com/data/mdac/downloads/default.aspx
 
If you are connecting to an Access (Jet) database (i.e. an MDB file) from
VB6 using ODBC, there is no Access process involved. Access is simply(!)
a
program that knows how to use the data stored in a Jet (MDB) database
file.

I understand.
1. You are not using MS Access. The "hang" is occurring in your
application somewhere (quite possibly in the ODBC library, as you
suspect).

I always thought that MS Access/MDB/ODBC/OLE-DB were part of the same thing,
Access.
3. Typically you are trying to perform a numeric operation on text
data,
or vice versa. If you posted your code or your SQL and some information
about the tables you are using then it should be pretty easy to spot.

It makes sense, but the problem is that it does not always happen, (I guess
because we use number/text properly most of the time).
Would there be a way for the ODBC, OLE-DB to log such errors? so I can see
where the query is coming from.
5. The error isn't coming from MS Access, because you are not using MS
Access. The error is arising in your application, and you can trap/handle
it using the usual VB6 error handling.

Thanks for the replies.
The messages are not coming from my application, they are from somewhere
else, ODBC, OLE-DB or what ever.

I just wanted to make certain that there was no way that the dll(s) could
throw messages boxes.

What might be a better NG to help me with ODBC, OLE-DB, (Access)?

Thanks again.

Simon
 
Simon said:
I understand.


I always thought that MS Access/MDB/ODBC/OLE-DB were part of the same thing,

No.


It makes sense, but the problem is that it does not always happen, (I guess
because we use number/text properly most of the time).
Would there be a way for the ODBC, OLE-DB to log such errors? so I can see
where the query is coming from.

It is probably dependent on what your users are entering. You should be
able to obtain enough information to track it down by implementing VB6 error
handling (I suggest you try a VB6 news group for help with that). Almost
certainly your validation is inadequate e.g. you are allowing them to enter
text for a value that should be numeric.
Thanks for the replies.
The messages are not coming from my application, they are from somewhere
else, ODBC, OLE-DB or what ever.

I didn't mean that your VB code was displaying the message box. What I
meant was that an error is being thrown because of a type mismatch, your
code is failing to trap and handle the error, and so a VB6 run-time error is
occurring.
I just wanted to make certain that there was no way that the dll(s) could
throw messages boxes.

What might be a better NG to help me with ODBC, OLE-DB, (Access)?

Thanks again.

Simon

The error may not even be related to the database! For example, try the
following code in VB6 (put it in the Click event for a command button):

Dim strString As String
Dim intInteger As Integer
intInteger = strString

What happens? Yes, you guessed it, Error 13, Type Mismatch. No database
involved whatsoever. So, I think your first mission is to find out exactly
what line of code the error occurs at by implementing some proper error
handling.
 
It is probably dependent on what your users are entering. You should be
able to obtain enough information to track it down by implementing VB6
error
handling (I suggest you try a VB6 news group for help with that). Almost
certainly your validation is inadequate e.g. you are allowing them to
enter
text for a value that should be numeric.

I tried that already, it looks like it is a very specific combination of
entries that cause that problem.
I didn't mean that your VB code was displaying the message box. What I
meant was that an error is being thrown because of a type mismatch, your
code is failing to trap and handle the error, and so a VB6 run-time error
is
occurring.

I see. I will need to ask the client again what the exact message is.
The error may not even be related to the database! For example, try the
following code in VB6 (put it in the Click event for a command button):

Dim strString As String
Dim intInteger As Integer
intInteger = strString

What happens? Yes, you guessed it, Error 13, Type Mismatch. No database
involved whatsoever. So, I think your first mission is to find out
exactly
what line of code the error occurs at by implementing some proper error
handling.

Thanks for the help.

Simon
 
Back
Top