Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MySql
 Fix: Type mismatch errors w/ MySQL 4.1 and above
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic   

JiveMiguel
Starting Member

USA
4 Posts

Posted - 01 December 2004 :  12:45:53  Show Profile
I think I’ve discovered the solution to this problem. The quick answer:
Go to config.asp and edit the MySQL connection string. Change OPTION=4 to OPTION=16387.

For a detailed explanation, which should be of interest to the developers and moderators, read on. Sorry this is so long, but I wanted to be sure to explain myself thoroughly. Keep in mind that this worked for me, your mileage may vary.

I just installed Snitz Forums version 3.4.05. I’m using it with MySQL 4.1, and MyODBC 3.51, all on a Windows 2000 server, running IIS5. I followed the setup instructions and everything went fine. When I went to view the forum page for the first time, I got the following error in the statistics section:

Type mismatch
/snitz/default.asp, line 923

I looked at the code, and noticed that the error was occurring during a comparison of integer values. I added the ‘cint’ function, and it fixed the problem. But, I then encountered the error again, and again and again at other points in the code on other pages. I looked deeper and found that the variable that was causing the error in the first instance (default.asp, line 923), ‘Member_Count’, was derived from a SELECT COUNT statement. A little more research revealed this:

http://dev.mysql.com/doc/mysql/en/count-error.html

The COUNT aggregate function in MySQL returns a BIGINT value. ADO doesn’t like BIGINTs, which I knew, so it converts the data to a string, which ultimately resulted in the ‘Type Mismatch’ error. Once I realized this, I examined the connection string used in config.asp. Sure enough, the OPTION= value wasn’t set correctly (based on my past experience). It came shipped set at ‘4’. I changed it to 16387 and all the ‘type mismatch’ errors went away! The values for the OPTION command can be found here:

http://www.dwam.net/mysql/asp_myodbc.asp

You’ll notice that option 16384 says “Change LONGLONG columns to INT columns, as some applications can't handle LONGLONG or BIGINT.” Add option 16384 with options 1 and 2 from the same list, (1+2+16384 = 16387) and you’ve specified to MyODBC the exceptions that it needs to consider when ADO is the client. If you read the page above carefully, the author states that as of MyODBC 3.51 you can use OPTION=3. I’ve found this to NOT be true, and that OPTION=16387 is still necessary, and works in EVERY case. It may be true that MyODBC now supports BIGINT, but ADO still does not.

I think this may solve a lot of problems people were having with Snitz Forums when using it with MySQL.

Thanks for reading, and good luck to all!
<

Edited by - Davio on 28 December 2004 12:49:50

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 01 December 2004 :  13:42:04  Show Profile
Thanks for that info Jive.<

Support Snitz Forums
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 01 December 2004 :  15:28:31  Show Profile  Send ruirib a Yahoo! Message
Indeed, thx Jive, that's a very useful info.<


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 01 December 2004 :  18:43:12  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
I remember looking for ages to find information on the option=4 parameter of the connection string.

Thanks for the explanation too.<

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

bescher
Starting Member

USA
4 Posts

Posted - 04 December 2004 :  13:56:26  Show Profile  Visit bescher's Homepage
Thank You it looks like this fixed my problems

Bob Escher<
Go to Top of Page

spyordie007
Junior Member

USA
408 Posts

Posted - 27 December 2004 :  19:11:24  Show Profile  Visit spyordie007's Homepage  Send spyordie007 an AOL message
thanks for the info, works for me<

Power - The only narcotic controlled by the SEC, not the FDA.

Prosperity without pollution! The American Hydrogen Association - http://www.ahanw.org
Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum
Go to Top of Page

Hopeful
Junior Member

130 Posts

Posted - 28 January 2005 :  23:41:45  Show Profile
My server (brinkster) just updated their mysql to version 4.1.8 from 4.0. My forum worked perfect before but now has numerous type mismatch errors... and it will say no topic found... I changed the option as stated above but it did not fix my problem. Does anyone know how to solve this?


NEVERMIND!!! Tech support had tried to change a few pieces of code to fix the mismatch error prior to me reading this so the option # change did not work, but once he changed everything back the option # change fixed everything!!! Thanks a million..... Should have checked here first before calling the server !
But hay... Now there is at least one tech support over there that is aware of the change needed to work with their new version of mysql!

<

Please explain everything in layman terms!!!

Edited by - Hopeful on 29 January 2005 00:08:02
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 29 January 2005 :  02:14:53  Show Profile
I don't want users start posting thier type mis-match problems in this topic, so I'm locking it. If you have problems, create a new topic about it.<

Support Snitz Forums
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 20 September 2006 :  14:40:32  Show Profile
FYI: the OPTION=16387 is now the default for Snitz Forums 3.4.06.<

Support Snitz Forums
Go to Top of Page
  Previous Topic Topic   
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000 Version 3.4.07