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
 File Attachment mod question
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

lancer
Starting Member

3 Posts

Posted - 03 June 2001 :  11:09:26  Show Profile
I've gotten the poll and events mods working fine, but now I'm having a small issue with the file attachment mod.

I'm getting this error:
----
Microsoft VBScript runtime error '800a01c9'

This key is already associated with an element of this collection

/forums/Mods/UploadEngine.asp, line 64
----

I've been doing some ASP programming for the last few months, but I've never come across this error before. Hopefully comeone can help me figure this one out.

I -think- it may have something to do with the database. I'm not sure, but I had to manually create the tables for this mod. So, heres a snipplet of code so you can see where the error is:

Set objDict = Server.CreateObject("Scripting.Dictionary")
set objRec = my_Conn.execute("SELECT * FROM " & strTablePrefix & "MODS WHERE M_NAME = 'Attachment' OR M_CODE = 'Attachment'")

while not objRec.EOF <<<--- LINE 64
objDict.Add objRec.Fields.Item("m_code").Value, objRec.Fields.Item("m_value").Value
objRec.moveNext
wend

MaxFileSize = cLng(objDict.Item("faMaxSize"))*512
strAllowedExtensions = objDict.Item("faExtensions")
boolAllowUploads = cint(objDict.Item("Attachment"))

objRec.Close
set objDict = nothing
set my_Conn = nothing

lancer
Starting Member

3 Posts

Posted - 03 June 2001 :  17:11:12  Show Profile
<bump>

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 04 June 2001 :  08:14:16  Show Profile  Visit HuwR's Homepage
the error normally means you have a duplicate record in your table.

Go to Top of Page

lancer
Starting Member

3 Posts

Posted - 05 June 2001 :  09:27:34  Show Profile
Thanks for the info. It seems that mod_dbsetup.asp has a way of seriously screwing up database work. I built the tables manually and it works perfectly.

I also made some changes to the code so theres another function called fileimg() which lets people upload a jpg/gif and instead of putting it in [url] tags it puts it in [img] tags and lets people upload screenshots right into the message.

The only downside is that it wouldn't let me use request.form to see if they picked the "attach image" icon was pressed instead of "attach file", so I had to use a session variable. Response.form isn't allowed after binaryread. bleh. If anyone wants the changes just let me know.

quote:

the error normally means you have a duplicate record in your table.





Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 06 June 2001 :  03:41:05  Show Profile  Visit HuwR's Homepage
quote:

Thanks for the info. It seems that mod_dbsetup.asp has a way of seriously screwing up database work. I built the tables manually and it works perfectly.

I also made some changes to the code so theres another function called fileimg() which lets people upload a jpg/gif and instead of putting it in [url] tags it puts it in [img] tags and lets people upload screenshots right into the message.

The only downside is that it wouldn't let me use request.form to see if they picked the "attach image" icon was pressed instead of "attach file", so I had to use a session variable. Response.form isn't allowed after binaryread. bleh. If anyone wants the changes just let me know.

quote:

the error normally means you have a duplicate record in your table.









The mod_dbsetup problem is because it does not know wether you already have the values in the MODS table, so it can create duplicates, this is more a problem with the MODS table, since it has no primary key.

My current unreleased version of attachments, checks the file extension and uses the image tag if it uploads an image file

Go to Top of Page
  Previous Topic Topic Next 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.35 seconds. Powered By: Snitz Forums 2000 Version 3.4.07