conceptmgt
IS-IT--Management
Hi
The code below worked fine uploading images to MS SQL but does not work on MYSQL. I keep getting the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Invalid string or buffer length
/newslettersystem/clients/newsletteraddp.asp, line 32
Any ideas?
Thanks
Gary
MYSQL Database:
CREATE TABLE `images` (
`ImageID` INT(4) NOT NULL auto_increment,
`ImagePath` text DEFAULT NULL,
`ImageBlob` longblob,
`ImageSize` bigint(20) DEFAULT NULL,
`ContentType` text DEFAULT NULL,
PRIMARY KEY (`ImageID`)
)
ASP Code:
Dim Uploader, File
Set Uploader = New FileUploader
Uploader.Upload()
theclientID = Uploader.Form("clientID"
curpage = request.querystring("curpage"
i = 0
For Each File In Uploader.Files.Items
Set Conn = Server.CreateObject("ADODB.Connection"
Set RS = Server.CreateObject("ADODB.Recordset"
Conn.open strconnect
RS.Open "Images", Conn, adOpenKeySet, adLockOptimistic, adCmdTable
RS.AddNew
RS("imagepath" = File.FileName
RS("imagesize" = File.FileSize
RS("contenttype" = File.ContentType
File.SaveToDatabase RS("imageblob"
RS.Update
ReDim Preserve arrImages(i)
arrImages(i) = RS("imageid"
RS.Close
conn.close
Set rs = Nothing
set conn = nothing
i = i + 1
Next
The code below worked fine uploading images to MS SQL but does not work on MYSQL. I keep getting the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Invalid string or buffer length
/newslettersystem/clients/newsletteraddp.asp, line 32
Any ideas?
Thanks
Gary
MYSQL Database:
CREATE TABLE `images` (
`ImageID` INT(4) NOT NULL auto_increment,
`ImagePath` text DEFAULT NULL,
`ImageBlob` longblob,
`ImageSize` bigint(20) DEFAULT NULL,
`ContentType` text DEFAULT NULL,
PRIMARY KEY (`ImageID`)
)
ASP Code:
Dim Uploader, File
Set Uploader = New FileUploader
Uploader.Upload()
theclientID = Uploader.Form("clientID"
curpage = request.querystring("curpage"
i = 0
For Each File In Uploader.Files.Items
Set Conn = Server.CreateObject("ADODB.Connection"
Set RS = Server.CreateObject("ADODB.Recordset"
Conn.open strconnect
RS.Open "Images", Conn, adOpenKeySet, adLockOptimistic, adCmdTable
RS.AddNew
RS("imagepath" = File.FileName
RS("imagesize" = File.FileSize
RS("contenttype" = File.ContentType
File.SaveToDatabase RS("imageblob"
RS.Update
ReDim Preserve arrImages(i)
arrImages(i) = RS("imageid"
RS.Close
conn.close
Set rs = Nothing
set conn = nothing
i = i + 1
Next