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: MOD Implementation
 Recipe Book Mod Error
 New Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

MaGraham
Senior Member

USA
1297 Posts

Posted - 05 July 2012 :  11:09:44  Show Profile  Reply with Quote


I just finished doing the "Recipe Book Mod" and I'm getting the following error message.


Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SHOW = 1' at line 1

/tfp/recipe.asp, line 1915


_______________________________________________________

Here are lines 1904 to 1924


subsql = "SELECT * FROM "& strTablePrefix & "RECIPE_SUBCATEGORIES WHERE CAT_ID=" & parent_id & " ORDER BY SUBCAT_NAME"

set rssubcat = my_Conn.Execute(subsql)
'count = rssubcat.RecordCount
'count = 1
do while not rssubcat.EOF 'and count<=3

Response.Write " <font face=""" & strDefaultFontFace & """ color=""" & strDefaultFontColor & """ size=""" & strFooterFontSize & """>" & vbNewLine & _
" <a href=""recipe.asp?action=showall&cat_id=" & rssubcat("subcat_ID") & "&parent_id=" & rsCategories("cat_id") & "&parent_name=" & ChkString(rsCategories("cat_name"), "urlpath") & "&sub_name=" & ChkString(rssubcat("subcat_name"), "urlpath") & """>" & ChkString(rssubcat("subcat_name"), "display") & vbNewLine

sqlcount = "SELECT COUNT(URL) FROM "& strTablePrefix & "RECIPE WHERE CATEGORY =" & rsSubcat("subcat_id") & " AND SHOW = 1"
Set RScounts = my_Conn.Execute(sqlcount)
rcounts = RScounts(0)
if rcounts <> 0 then
Response.Write " (" & rcounts & ")"
end if
Response.Write "</a>"

rssubcat.movenext
if rsSubcat.eof then Response.Write "" else Response.Write ", "





Here's a link to my entire recipe.asp in txt format.


recipe.asp in txt format





"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 05 July 2012 :  18:55:39  Show Profile
The reason for the error is because the word "Show" is restricted (not allowed as a column name in the database) when using MySQL. It will have to be renamed and all references to it changed to reflect the new name.
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 05 July 2012 :  21:34:56  Show Profile
quote:
Originally posted by Carefree

The reason for the error is because the word "Show" is restricted (not allowed as a column name in the database) when using MySQL. It will have to be renamed and all references to it changed to reflect the new name.



All of the words "Show" in my recipe.asp file?



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 06 July 2012 :  00:38:29  Show Profile


I replaced all of the words "show" with "display" in my recipe.asp. Hope that was okay!


I am still getting this error though.



Microsoft OLE DB Provider for ODBC Drivers error '80040e37'

[MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-nt]Table 'tfpmembers.forum_recipe' doesn't exist

/tfp/recipe.asp, line 1915








"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 06 July 2012 :  06:09:07  Show Profile
No, that was not what I meant nor what needed to be done.

1) In the database table (_RECIPE) for the recipe mod, the field titled "SHOW" must be renamed to something else (i.e., RECIPE_SHOW).

2) Whatever is chosen, all SQL routines calling/editing that field must be changed to show the new field title.

I modified it and put it up on SnitzBitz.

Not running a copy on a MySQL database, but I included a dbs file to rename the column in the table. Hope I have the syntax correct. If it errors, use this (call it whatever you'd like), I think it'll work:


<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
my_Conn.Execute("ALTER " & strTablePrefix & "RECIPES CHANGE SHOW TO RECIPE_SHOW INT NOT NULL 0;")
Response.Write	"Done!"
WriteFooter
%>

Edited by - Carefree on 06 July 2012 08:47:18
Go to Top of Page

MaGraham
Senior Member

USA
1297 Posts

Posted - 12 July 2012 :  05:04:52  Show Profile


I am unable to edit the MySQL directly because of the column name error.

Are there any of you MySQL gurus out there reading this?

With your expertise, surely you could solve the MySQL dbs file issue.


The "Recipe Book Mod" is such an awesome mod! The fact that the members can upload their own personal picture of their recipe is such an attention-getter for my members. They LOVE to have whatever they have prepared on their attractively decorated table and make everyone drool over it! There would probably be a lynching if my members thought I might not be able to have it on the new database!


Any help with this would be Sooooo appreciated!




"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 12 July 2012 :  05:33:37  Show Profile  Send ruirib a Yahoo! Message
Wherever you have the problematic word SHOW occurring, just replace it by `SHOW`. It's all that's needed. There is no need to change column names. You really need to use those "backtick" characters to escape the word.


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

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 12 July 2012 :  10:32:12  Show Profile
So conceivably, Rui, that strSql from above could work like this?

my_Conn.Execute("ALTER " & strTablePrefix & "RECIPES CHANGE `SHOW` TO RECIPE_SHOW INT NOT NULL 0")
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 12 July 2012 :  10:59:18  Show Profile  Send ruirib a Yahoo! Message
Yes, but why do that? Wouldn't just be easier to change SHOW to `SHOW` in every file where it is used?


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

Carefree
Advanced Member

Philippines
4222 Posts

Posted - 12 July 2012 :  18:04:12  Show Profile
Because I already rewrote all of the files and repackaged it. Just need to make the dbs file work so those who installed the original version can use MySQL.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 12 July 2012 :  19:56:55  Show Profile  Send ruirib a Yahoo! Message
Escaping with backtick chars works in all circumstances.


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

MaGraham
Senior Member

USA
1297 Posts

Posted - 13 July 2012 :  12:45:13  Show Profile
quote:
Originally posted by ruirib

Escaping with backtick chars works in all circumstances.




This didn't work for me. Am I doing something wrong? I am receiving the following error:


Microsoft VBScript compilation error '800a03ea'

Syntax error

/tfp/recipe.asp, line 39

if 'show' = "10" then
---^




"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 July 2012 :  12:55:11  Show Profile  Send ruirib a Yahoo! Message
You cannot use apostrophes. I suggest that you copy what you need from my previous post. The character in question is used as an accent in some languages like my own. Here, copy this:

`show`


Just reply with a quote and you can copy it easily.


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

MaGraham
Senior Member

USA
1297 Posts

Posted - 13 July 2012 :  13:08:47  Show Profile
quote:
Originally posted by ruirib

You cannot use apostrophes. I suggest that you copy what you need from my previous post. The character in question is used as an accent in some languages like my own. Here, copy this:

`show`


Just reply with a quote and you can copy it easily.



I tried yours again and again and again yesterday and gave up. I replied with a quote and tried yours again just now. I get this error when I copy yours:

Microsoft VBScript compilation error '800a0408'

Invalid character

/tfp/recipe.asp, line 26

`show` = Request("num")
^



So, what am I doing wrong?



"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 July 2012 :  13:19:31  Show Profile  Send ruirib a Yahoo! Message
What are you doing? This should only be done in SQL statements?!


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

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 13 July 2012 :  13:24:47  Show Profile  Send ruirib a Yahoo! Message
In recipe.asp, only lines with the numbers 40, 129 and 228 need changing.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.35 seconds. Powered By: Snitz Forums 2000 Version 3.4.07