Topic awaiting preservation: data type mismatch |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: KY |
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 & "'")
|
Paranoid (IV) Mad Scientist From: Somewhere over the rainbow |
posted 01-15-2003 15:15
The poster has demanded we remove all his contributions, less he takes legal action. |
Bipolar (III) Inmate From: Australia |
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 ....... |
Bipolar (III) Inmate From: KY |
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? |
Bipolar (III) Inmate From: Australia |
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 |
Obsessive-Compulsive (I) Inmate From: Augusta, ME |
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. |