|
I can add data from asp page into database
I write "upload file" page by asp and want to store information about file into database file that is written by microsoft access 2007.I test it.File is uploaded already but it's not save to database it's show error like this
".Technical Information (for support personnel)
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
/mywebproject/createfilesv.asp, line 22
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; SIMBAR Enabled; SIMBAR={8E9E36DB-BE9E-427c-B503-C24DDC080BD7}; .NET CLR 2.0.50727; MEGAUPLOAD 1.0; InfoPath.2; MEGAUPLOAD 2.0)
Page:
POST 6409 bytes to /mywebproject/createfilesv.asp
POST Data:
error '80020009'
Exception occurred.
/iisHelp/common/500-100.asp, line 223"
This's code in client side
<html>
<head>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<title>Upload File Page</title>
</head>
<body background="c:\inetpub\wwwroot\mywebproject\In_The_Shadow_Of_The_Stars%2C_Space_Art.jpg">
<br><br><br><br><br><br><br><center><font face="DilleniaUPC" size="5"color=white><b><u>Upload file</u></b></font><br><br><br><table border=0><tr><td></td><td align="left">
<form enctype="multipart/form-data" method="post" action="createfilesv.asp">
<font face="DilleniaUPC" color=white size="4">Your Name:</b><input type=text size=40 name="fullname"><br><br>
File: <input type="file" name="f1" size="40"><br><br>
Description: <input type="text" name="description" size=40><br><br>
<input type="submit" value="Upload" name="uploadbut"></font>
</form></td><td></td></tr></table></center>
</body>
</html>
This is code in sever side
<%@ Language=VBScript %>
<!-- #include file="upload.asp" -->
<%
Dim Uploader,File
Set Uploader = New FileUploader
Uploader.Upload()
Response.Write "<b>Thank you for your upload " & Uploader.Form("fullname") & "</b><br>"
If Uploader.Files.Count = 0 Then
Response.Write "File(s) not uploaded."
Else
For Each File In Uploader.Files.Items
File.SaveToDisk "C:\upload\"
Response.Write "File Uploaded: " & File.FileName & "<br>"
Response.Write "Size: " & File.FileSize & " bytes<br>"
Response.Write "Type: " & File.ContentType & "<br><br>"
Set ObjDB=Server.CreateObject("ADODB.Connection")
ObjDB.Provider="Microsoft.Jet.OLEDB.4.0"
ObjDB.Open "c:\inetpub\wwwroot\mywebproject\fileinfo.mdb"
Set Rs=Server.CreateObject("ADODB.Recordset")
SQL="Select * From FileInfo"
Set ObjRS=ObjDB.Execute(SQL)
ObjRS.Addnew
ObjRS.Fields("UploadDate")= Now
ObjRS.Fields("FileName")=File.FileName
ObjRS.Fields("Description")=Request.Form("description")
ObjRS.Update
ObjRS.Close
ObjDB.Close
Set ObjRS=Nothing
Set ObjDB=Nothing
Next
End If
%>
How to solve this I have to sent it next week.
Last edited by davincith; 09-17-2007 at 01:17 PM..
|