Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-17-2007, 01:14 PM   PM User | #1
davincith
New to the CF scene

 
Join Date: Sep 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
davincith is an unknown quantity at this point
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:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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..
davincith is offline   Reply With Quote
Old 09-17-2007, 01:27 PM   PM User | #2
Daemonspyre
Regular Coder

 
Join Date: Mar 2007
Posts: 505
Thanks: 1
Thanked 19 Times in 19 Posts
Daemonspyre is on a distinguished road
DaVinciTh --

You need to open your connection with the correct cursor types.

Google:

adUseClient

and your error message:

Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
__________________
Quote:
To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
Please, if you found my post helpful, pay it forward. Go and help someone else today.
Daemonspyre is offline   Reply With Quote
Old 09-18-2007, 12:52 AM   PM User | #3
davincith
New to the CF scene

 
Join Date: Sep 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
davincith is an unknown quantity at this point
How? Tell me the solution of the code
davincith is offline   Reply With Quote
Old 09-18-2007, 02:01 PM   PM User | #4
Daemonspyre
Regular Coder

 
Join Date: Mar 2007
Posts: 505
Thanks: 1
Thanked 19 Times in 19 Posts
Daemonspyre is on a distinguished road
Did you Google what I told you to?

It has the answers you are looking for.
__________________
Quote:
To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
Please, if you found my post helpful, pay it forward. Go and help someone else today.
Daemonspyre is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:56 AM.


Advertisement
Log in to turn off these ads.