Closed Thread Icon

Topic awaiting preservation: data type mismatch (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12578" title="Pages that link to Topic awaiting preservation: data type mismatch (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: data type mismatch <span class="small">(Page 1 of 1)</span>\

 
Ensabanur
Bipolar (III) Inmate

From: KY
Insane since: Nov 2001

posted posted 01-15-2003 15:09

I can't for the life of me figure out what's wrong with this line

code:
conn.execute("update inventory set first_name = '" & first & "', last_name = '" & last & "', Item = '" & item1 & "', Serial = '" & serial1 & "', JWtag = '" & tag1 & "', Status = '" & status1 & "', info = '" & info1 & "', equipment = '" & equi & "',  dment = '" & department & "' where ID = '" & whichitem & "'")


I keep getting a data type mismatch in query expression message. I've checked the data base and all the types are correct. Anyone have any ideas?

Thanks
Ensa

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 01-15-2003 15:15

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

posted posted 01-15-2003 15:29

Mmm ive had this error before, for an access database too - access aint all that bad =) but then again i have done much sql database .......

Might need a bit more info on your table data too see whats going on, data type mismatch might just mean your trying to put a text value into a numbered field or the likes so you might want to check that.

Ensabanur
Bipolar (III) Inmate

From: KY
Insane since: Nov 2001

posted posted 01-15-2003 15:55

It is an Access DB, sorry, I know it isn't that great, but it suits my needs and works well for me (except for now) I Know there aren't any relationships set up. I can access all the data with a select command. I know the value types are correct... I've checked that, it seems, a thousand times. I don't suppose there's anything about the line of code

code:
conn.execute("update inventory set first_name = '" & first & "', last_name = '" & last & "', Item = '" & item1 & "', Serial = '" & serial1 & "', JWtag = '" & tag1 & "', Status = '" & status1 & "', info = '" & info1 & "', equipment = '" & equi & "',  dment = '" & department & "' where ID = '" & whichitem & "'")

that just jumps out at you as being incorrectly formatted?


Thanks

Ensa

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

posted posted 01-16-2003 03:38

Hmm not that i can see, i remember having this exact same error. I think my problem was i was using some values that access has set aside and you simple arent allowed to use, things like password etc. But what you have looks fine..... do some debugging or something and put a list of everything that is about to go into your database and make sure they are what you expect, maybe another part of the code is changing something

mainewoods
Obsessive-Compulsive (I) Inmate

From: Augusta, ME
Insane since: Jan 2003

posted posted 01-24-2003 02:43

I noticed that in your sql statement you have all of your values surrounded by the single quotes ' '. If any of your fields in the access table are specified as type numeric then you should not surround the values with quotes . For instance if your department field is actually a numeric field then the sql statement for that should say: department = 1 instead of department = '1'. A couple of your fields look suspicously like you may have defined them as numeric type fields in your access database and that would cause the stated problem.

« BackwardsOnwards »

Show Forum Drop Down Menu