Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Posts
    7

    Unanswered: 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

  2. #2
    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

  3. #3
    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

  4. #4
    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?

  5. #5
    Join Date
    Aug 2003
    Location
    Kayseri-Turkiye
    Posts
    7
    I dont know exact problem but you can try this.:

    rs("[File Data]")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •