THis cant be happening..... (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


51 -> THis cant be happening..... (10/9/2003 16:06:59)

Anyone please help, this has got to something minor to repair, I keep getting this error (error '80020009' ) when I run this small .asp code.

<HTML>
<BODY>

<%
Set Upload = Server.CreateObject("Persits.Upload")

' Capture files
Upload.Save "c:\upload"

' Obtain file object
Set File = Upload.Files("THEFILE")

If Not File Is Nothing Then
' Build ODBC connection string
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "aspupload", , ""
Set rs = Server.CreateObject("ADODB.Recordset")
' rs.Open sql, conn, 3, 3

' Connect = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath(".\aspupload.mdb")

' If you use SQL Server, the connecton string must look something like this:
' Connect = "Driver=SQL Server;Server=MYSRV;Database=master;UID=sa;PWD=xxx"

' Build SQL INSERT statement
SQL = "INSERT INTO MYIMAGES(image_blob, filename, description, filesize) VALUES(?, '"
SQL = SQL & File.Filename & "', '"
SQL = SQL & Replace(Upload.Form("DESCR"), "'", "''") & "', "
SQL = SQL & File.Size & ")"

' Save to database
File.ToDatabase Connect, SQL
Response.Write "File saved."
Else
Response.Write "File not selected."
End If
%>

</BODY>
</HTML>

the blue bold line is where explorer tells me the error is.
Thanks for you time.




BeTheBall -> RE: THis cant be happening..... (10/9/2003 16:33:29)

Does this help: Microsoft Article




51 -> RE: THis cant be happening..... (10/10/2003 8:26:06)

Not really, I know its something minor with the save methodology




BeTheBall -> RE: THis cant be happening..... (10/10/2003 12:07:18)

If I understand the article correctly, I think you need to move the blob info to the end of your SQL. In other words, image_blob would be the last item in the INSERT statement.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875