Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 23rd, 2003, 03:52 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Server cannot complete operation

Hi,

I'm working through the Record and Stream examples in Ch. 14 and am running into the error message: "Server cannot complete operation". It happens on the "objRecord.CopyRecord" method in the "RecordMove.asp" file. I even checked all the boxes in the Properties|Directory tab for the "TestFolder" web application, without success. Is there something I'm missing? I'm including the full error display below.

Thanks


HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
ADODB.Record (0x800A0E94)
Server cannot complete the operation.
/begasp/RecordMove.asp, line 26


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461; .NET CLR 1.0.3705)

Page:
POST 9 bytes to /begasp/RecordMove.asp

POST Data:
Task=Copy

Time:
Thursday, October 23, 2003, 1:43:06 PM


More information:
Microsoft Support

  #2 (permalink)  
Old November 3rd, 2003, 02:33 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here's the code which causes the problem (from page 620 in my book):

Dim objRecord
Set objRecord = Server.CreateObject("ADODB.Record")
objRecord.Open "MyText.txt", "URL=http://<server_name>/BegASP"
If Request.Form("Task") = "Copy" Then
   objRecord.CopyRecord "", "http://<server_name>/TestFolder/MyText2.txt",,,adCopyOverWrite
Response.Write "MyText.txt file copied to a new file called MyText2.txt"
ElseIf Request.Form("Task") = "Move" Then
objRecord.MoveRecord "", "http://<server_name>/TestFolder/MyText2.txt",,,adMoveOverWrite
Response.Write "MyText.txt file moved to a new file called MyText2.txt"
ElseIf Request.Form("Task") = "Delete" Then
objRecord.DeleteRecord
Response.Write "MyText.txt has been deleted"
End If
objRecord.Close
Set objRecord = Nothing

(Sorry about the bad formatting with plain text).


  #3 (permalink)  
Old November 3rd, 2003, 04:40 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

I am not too familiar with the Record object in ADO as I never had to use it. If you're trying to copy or move files locally, simply use the FileSystemObject.

If you're trying to open a page on a remote server, you might be interested in this article: http://www.aspfaq.com/show.asp?id=2173

For more info about the Record and its Open and other methods, check out this MSDN section: http://msdn.microsoft.com/library/de...daobj01_17.asp

I had to stop my firewall to get part of this code to work (I got a bunch of errors as well), so maybe that's causing the problems.
Also, make sure your permissions are set correctly. You could start by granting full control to Everyone and see if that helps. If it does, change the rights so just the necessary accounts have access to your web folder (IUSR, IWAM and any other account you might use for Integrated or Basic security). Be careful with this; you're exposing your server to a lot of problems if you disable your firewall and give full access to everyone. Make sure you restore the permissions when you're done testing.... ;)

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #4 (permalink)  
Old November 3rd, 2003, 04:47 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Imar, for all your suggestions. I'll give them a try and I'll check out the URLs you mentioned. As far as security is concerened, I typically disable my network connection and enable my "Microsoft Loopback Connection" while I'm developing/testing. This makes everything (IIS, browser, etc) operate in an Internet environment without being actually connected, so no intrusions are possible.

  #5 (permalink)  
Old November 3rd, 2003, 05:01 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Right, that makes a lot of sense.

One more thing, I believe that for the Record.Open method, you need to have the OleDB for Internet Publishing driver installed. Is that one present on your system?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #6 (permalink)  
Old November 3rd, 2003, 07:53 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I believe that I've got it installed. It took me a while and some searching to find this MDAC tool on MS's website (ComCheck) which runs a complete search on your system and can detect all MDAC components installed on your system (up to 2.7, does not detect 2.8). So I think I have everything that I should have. I'll try the FIleSystemObject myself, but I'm concerned that the example in the book which does use the Record object does not work, and if it should, then I'd really like to find out why it isn't.

  #7 (permalink)  
Old November 4th, 2003, 04:16 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Well, if you do, please drop a line. I think I'd do the same: something that is supposed to work, just has to work, right?, even if there are good work-arounds available. Apparently it used to work when the book was written, so it has to work now too.

I checked Google for the error message and ran into a couple of posts on message boards, all reporting more or less the same problem. I am really curious what's causing it.

Regards,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #8 (permalink)  
Old November 7th, 2003, 01:36 AM
Registered User
 
Join Date: Nov 2003
Location: Mt.Carmel, IL, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was using the virtual server on my laptop and had this problem also. The problem lies with the permissions for the server.
Try going to the Properties of the 'Default Web Site' from there go to the 'Home Directory', add 'Write'. After you accept then you will get an Inheritance Override window. There find the folder you are using (ie BegASP)click on it.
After doing this my program 'RecordMove.asp' worked.
Good Luck
:)

Every problem has a solution!
  #9 (permalink)  
Old November 7th, 2003, 02:48 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Peachy,

Thanks for your reply. I tried your suggestion and I guess I did make some progress. The message changed from "Server cannot complete operation" to "Permissions are insufficient to access tree or subtree".

I selected both BegASP and TestFolder from the list, and even restarted IIS and still got the message. Any other thoughts?

  #10 (permalink)  
Old November 7th, 2003, 10:00 PM
Registered User
 
Join Date: Nov 2003
Location: Mt.Carmel, IL, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When you added "Write" make sure you didn't uncheck the boxes already checked.


Every problem has a solution!
 


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The data necessary to complete this operation is n surendran Ajax 0 October 2nd, 2008 11:37 PM
Complete URL safin ASP.NET 2.0 Professional 0 February 2nd, 2006 02:36 PM
Complete Noob KnowTheForce Beginning VB 6 3 December 19th, 2005 10:09 PM
Can't complete the projects TheKOTG VB.NET 2002/2003 Basics 1 February 4th, 2005 09:49 AM
Auto Complete sridevi HTML Code Clinic 4 June 28th, 2004 06:45 AM



All times are GMT -4. The time now is 11:38 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.