If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Adding New File Record Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-04-03, 04:54
johnan johnan is offline
Registered User
 
Join Date: Aug 2003
Posts: 7
Adding New File Record Problem

Hey guys, I get this error when I try to add a new file record to my database.I'm working with SQL server 2000.

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

The line giving this problem is below:

Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Files", "DSN=MyDSN;UID=sa;PWD=pass", 2, 2
RS.AddNew ' create a new record

RS("FileName") = File.FileName <------ Problem
RS("FileSize") = File.FileSize
RS("ContentType") = File.ContentType

' Save the file to the database
File.SaveToDatabase RS("filedata")

' Commit the changes and close
RS.Update
RS.Close
Reply With Quote
  #2 (permalink)  
Old 08-04-03, 21:16
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
You didn't create any object called File so you can't use File.BlahBlahBlah.
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
  #3 (permalink)  
Old 08-04-03, 23:46
johnan johnan is offline
Registered User
 
Join Date: Aug 2003
Posts: 7
Hi thanks for your response.
I still cant get it to work for the database part.
It works fine when I save it to the harddisk though.
Anyone can give me some advice?
Thanks
Reply With Quote
  #4 (permalink)  
Old 08-05-03, 00:21
johnan johnan is offline
Registered User
 
Join Date: Aug 2003
Posts: 7
Woohoo!
I solved the problem above~ but now I have another error.
Hm, I'm kinda new at this and am doing a project.
The error is below:

ADODB.Field (0x800A0C93)
Operation is not allowed in this context.

rs("File Data").AppendChunk fileData <----This line is giving the error.

Anyone know why?
Reply With Quote
  #5 (permalink)  
Old 08-06-03, 04:54
aliayen aliayen is offline
Registered User
 
Join Date: Aug 2003
Location: Kayseri-Turkiye
Posts: 7
I dont know exact problem but you can try this.:

rs("[File Data]")
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On