March 17th, 2003, 09:59 AM
MYSQL upload file w/ aspSmartUpload don't work!
I really can't get my File data uploaded into the database
My table called "file" have the following structure:
id..................tinyint(3) unsigned NOT NULL auto_increment
name............varchar(64) default '0'
date_added..varchar(10) default '0'
size...............int(6) unsigned default NULL
Everything works fine until the BinaryData is about to be inserted.
This is my code for adding a file:
...returns an error msg:
' // Lägger till ny post i slutet med följande data
rec("id") = NULL
rec("name") = object.Filename
object.FileToField rec.Fields("content")' // Line simply don't work!
rec("date_added") = date
rec("size") = object.Size
rec("folder_id") = file.form("folder")
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Ogiltig längd på sträng eller buffert
...and in english something like "Invalid length of string or buffer"
However, all other fields get inserted properly if i comment the error line (content)
I have also tried to manually inserted the data using
but that don't work either.
rec("content") = object.BinaryData
One said this has something to do with the ODBC Driver (I use 3.51) and that it works fine in Access, but i would REALLY don't like to swith to access.
Also if you need i use those properties:
rec.ActiveConnection = con
rec.Source = sql
rec.CursorType = adOpenStatic
rec.LockType = adLockOptimistic
I would REALLY appreciate all help
Thanks in advance,