Author |
Topic |
|
Gort
New Member
84 Posts |
Posted - 21 April 2006 : 19:25:24
|
I'm using avatar categories by SiSL on top of Avatar MOD. My files will upload but they won't write to the DB:
The strCatID is not making its way into my sql statement. A response.write on the sql statements gives the following:
INSERT INTO FORUM_AVATAR (A_URL, A_NAME, A_MEMBER_ID, A_CATID) VALUES ('avatars/batman1.jpg', 'batman1', 0, ) Microsoft JET Database Engine error '80040e14' Syntax error in INSERT INTO statement.
/board/avatar_upload.asp, line 201
Does anyone have any ideas?
|
|
Gort
New Member
84 Posts |
Posted - 21 April 2006 : 19:53:43
|
I think I've narrowed the problem down to line 238:
If File.WasSuccess then File.SaveToAvatar strTablePrefix,strConnString,UploadStuff.Form("CatID"),UploadStuff.Form("destination")
But I'm not sure what's wrong. Somehow the CatID (obtained in a SELECT form element) is not being passed... |
|
|
SiSL
Average Member
Turkey
671 Posts |
|
Gort
New Member
84 Posts |
Posted - 21 April 2006 : 20:42:18
|
Yes, there are three categories. Here's source code from the upload form html: <select name="CatID" id="CatID"> <option value="5">Batman</option> <option value="1">Misc</option> <option value="6">Star Wars</option> </select>
|
|
|
Gort
New Member
84 Posts |
Posted - 21 April 2006 : 20:44:55
|
I added a response.write to debug: Response.Write UploadStuff.Form("CatID") Before If File.WasSuccess then File.SaveToAvatar strTablePrefix,strConnString,UploadStuff.Form("CatID"),UploadStuff.Form("destination")
And UploadStuff.Form("CatID") is empty |
|
|
Gort
New Member
84 Posts |
Posted - 21 April 2006 : 20:56:59
|
I should also note that if I replace strSql = strSql & ", " & strCatID With strSql = strSql & ", 5" THEN it works. The problem is with strCatID... |
|
|
SiSL
Average Member
Turkey
671 Posts |
|
Gort
New Member
84 Posts |
Posted - 21 April 2006 : 21:37:27
|
Yes, it's there (I swapped URL and CATID during debugging): Public Function SaveToAvatar(strTablePrefix,strDbConnection,strCatID,strURL)
Thanks for the help! I posted the .txt file here: http://www.gortner.com/board/avatar_upload.txt
|
|
|
SiSL
Average Member
Turkey
671 Posts |
|
modifichicci
Average Member
Italy
787 Posts |
|
Gort
New Member
84 Posts |
Posted - 22 April 2006 : 08:12:10
|
The order of those variables doesn't matter - I switched them in all the appropriate places when I was debugging..replacing chkString(strCatID,"number")) with strCatID was also part of debugging....
Here's the othe file SiSL requested: http://www.gortner.com/board/admin_avatar_upload.txt
|
|
|
SiSL
Average Member
Turkey
671 Posts |
|
Gort
New Member
84 Posts |
Posted - 22 April 2006 : 22:16:14
|
I've now tried them on both.
I added the </form> but it didn't help.
I guess there must be some problem with the way my server is grabbing the form data. UploadStuff.Form("CatID") is empty.
I tried to follow the variable path. My ASP knowlegdge ends with simple request.form objects. The variable path: CatID (form element in admin_avatar_upload.asp)-->submit form-->UploadProcess()-->?-->UploadStuff.Form("CatID") -->File.SaveToAvatar -->strCatID added to SQL statement
|
|
|
Gort
New Member
84 Posts |
Posted - 22 April 2006 : 22:25:47
|
I think I have a workaround - just use strSql = strSql & ", 5" where 5 is a default category. Then I can use the avatar admin to move my avatars to different categories.
That should work....but I'm pretty frustrated I can't get your code to work when it should be work fine. It must be something out of my control...the code seems to grab input form elements correctly. Maybe it has a problem with the select form element.... |
|
|
Zuel
Average Member
USA
540 Posts |
Posted - 22 April 2006 : 23:11:50
|
I don't know if it makes a difference but make sure all the variable names and forms names are consistant throughout the code. I know this makes a difference with radio buttons.
I believe IE is case insensitive while Firefox is case sensitive. |
My Completed Mods: News Mod | Zuel's Avatar Add-on In Development: World of Warcraft Member Roster | [C# Based Forum]
Note - I may take a few days to recieve your email. Hotmail filters all new emails as junk. Would be best to post all questions, concerns in a forum topic to catch my immediate attention. This way others can assist and also correct any similar mistakes.
MSN / E-Mail: ucyimDa_Ruler@Hotmail.com
Personal Bookmarks: How to work a DBS File
|
|
|
SiSL
Average Member
Turkey
671 Posts |
|
|
Topic |
|