Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ADO/ODBC : Help using this with MySQL Signup · Login
Author Thread
Help using this with MySQL
Posted in tutorial: Uploading Files into an Access Database using plain ASP
·  wiggsfly
User
Joined: 15 Apr 2004
Total Posts: 2
Help using this with MySQL
Posted: 15 Apr 2004
Hello, I've gotten close but I still keep getting the following error.

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Invalid string or buffer length

/faculty/submit/update/addpicproc.asp, line 55



Here is the code for that:

Response.Buffer = True

Dim load
Set load = new Loader

load.initialize


Dim fileData
fileData = load.getFileData("PicFile")

Dim fileName
fileName = LCase(load.getFileName("PicFile"))

Dim filePath
filePath = load.getFilePath("PicFile")

Dim filePathComplete
filePathComplete = load.getFilePathComplete("PicFile")

Dim fileSize
fileSize = load.getFileSize("PicFile")

Dim fileSizeTranslated
fileSizeTranslated = load.getFileSizeTranslated("PicFile")

Dim contentType
contentType = load.getContentType("PicFile")

Dim countElements
countElements = load.Count

Dim idInput
idInput = load.getValue("FacultyID")

Set load = Nothing

Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn=("server=localhost;db=aviation;driver=MySQL ODBC 3.51 Driver;uid= ;pwd=")

Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")

rs.Open "Facultypics", Conn, 2, 2

rs.AddNew
rs("FileName") = fileName
rs("FileSize") = fileSize
rs("FileData").Appendchunk fileData
rs("ContentType") = contentType
rs("FacultyID") = idinput
rs.Update

rs.Close
Set rs = Nothing
Conn.Close

If Err.number = 0 Then
Response.Redirect "faculty/submit/update/index.asp?FacultyID="&idinput&"&Birth="&Request("Birth")
Else
Response.Write "Could not insert into Database. Errors occured ...<br>"
End If

Users Who Have Visited This Thread In Last 24 Hours
4 Visitors

Login
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2009 Stardeveloper.com, All Rights Reserved.