Access DB Update Problems

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Access DB Update Problems

Post by shiznatix »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Ok so sadly I am trying to fix this old site that uses an access DB for its database (/me puking green slime). For some reason I can not update this one row, it keeps saying 'data type mismatch' but when any other ID it works fine. This is the query that won't run:

[syntax="sql"]UPDATE members SET `northhills`='off',`southhills`='off',`downtown`='off',`monroeville`='on', `airportarea`='off',`cranberry`='off',`beaver`='off',`washington`='off', `westmoreland`='off',`sewickley`='off',`status`='active',`employees`='',`discountspecial`='', `contact`='Josh Gross',`company`='Aurora Electrical & Data Services',`street`='2740 Smallman Street',`address2`='Suite 600',`city`='Pittsburgh', `state`='PA',`zip`='15222-4720',`phone`='412-255-4060',`fax`='412-255-4089',`email`='jgross@franklininteriors.com',`url`='', `bd`='',`category`='Electricians',`challenge`='',`membersince`='', `lead`='',`highlight1`='',`highlight2`='', `highlight3`='',`highlight4`='',`highlight5`='',`username`='**',`password`='**' WHERE `id` = 1160
and it is saying that the id = 1160 <- that is where the datatype mismatch is coming. any other number seams to be going through just fine. I have no idea why or whatever. The datatype is set to 'AutoNumber' and it auto increments.

Any ideas would be awesome.


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

I would have to say that it is probably referring to a different field, not the ID. Take a close look at the contents of that record. MS Access isn't really a bad database engine at all, it's just fine tuned for a different set of uses than MySQL. It is very fussy about data types, though, which isn't necessarily a bad thing.
Post Reply