Item cannot be found in the collection corresponding to the requested name or ordinal.

Hi,
I am using Dreamweavers User Authentication tool, and all seems to be working except when I press the 'Submit' button I get the following error;
ADODB.Fields error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
/coding/test_login.asp, line 35
As far as I can tell the user login works, as I can assess the restricted page, if I manually type in the URL.
My code is listed below;
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/Conn_PSCRM_Demo.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername = CStr(Request.Form("usercode"))
If MM_valUsername <> "" Then
  Dim MM_fldUserAuthorization
  Dim MM_redirectLoginSuccess
  Dim MM_redirectLoginFailed
  Dim MM_loginSQL
  Dim MM_rsUser
  Dim MM_rsUser_cmd
  MM_fldUserAuthorization = """group"""
  MM_redirectLoginSuccess = "yes.asp"
  MM_redirectLoginFailed = "no_access.asp"
  MM_loginSQL = "SELECT usercode, epros_password"
  If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
  MM_loginSQL = MM_loginSQL & " FROM DBA.[user] WHERE usercode = ? AND epros_password = ?"
  Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
  MM_rsUser_cmd.ActiveConnection = MM_Conn_PSCRM_Demo_STRING
  MM_rsUser_cmd.CommandText = MM_loginSQL
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 255, MM_valUsername) ' adVarChar
  MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 255, Request.Form("password")) ' adVarChar
  MM_rsUser_cmd.Prepared = true
  Set MM_rsUser = MM_rsUser_cmd.Execute
  If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
    ' username and password match - this is a valid user
    Session("MM_Username") = MM_valUsername
    If (MM_fldUserAuthorization <> "") Then
      Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
    Else
      Session("MM_UserAuthorization") = ""
    End If
    if CStr(Request.QueryString("accessdenied")) <> "" And true Then
      MM_redirectLoginSuccess = Request.QueryString("accessdenied")
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginSuccess)
  End If
  MM_rsUser.Close
  Response.Redirect(MM_redirectLoginFailed)
End If
%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<form action="<%=MM_LoginAction%>" method="POST" name="logon">
<input name="usercode" type="text"><br>
<input name="password" type="text">
<input type="submit" name="Submit" id="Submit" value="Submit">
</form>
</body>
</html>
Any help greatly accepted.

There are several workarounds you could use. I would start by setting the local variable back to the actual column name
MM_fldUserAuthorization = "group"
and then modify the reserved word directly SQL. See if this works:
  If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & """MM_fldUserAuthorization"""
If that line doesn't work, then you might need to concatenate the quotes around the variable, or try a combination of single/double quotes.
Also be warned that once you modify DW's generated code, you probably will not be able to maintain the code in DW server behavior wizard. You'll need to maintain by hand.
Good luck.

Similar Messages

  • HT5129 The photo "claire-66.jpg" could not be opened, because the original item cannot be found.

    because of the mobile me switch i can not use my iphoto. i had some albums in my mobile me web gallery and one of them i had deleted the original files so it will not allow me to use my iphoto because it keeps giving me this error message and i can't get rid of it.
    "The photo “claire-66.jpg” could not be opened, because the original item cannot be found."
    I don't have the original photo anymore so i can not link it to it.

    So, your iPhoto Library is now corrupted.
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  

  • The photo "IMG_5310.JPG" could not be opened, because the original item cannot be found.

    Each time I open iPhoto or plug in a device and iPhoto automatically opens, the following message appears five times, looking for photos I assume I deleted, perhaps the wrong way. 
    The photo “IMG_5310.JPG” could not be opened, because the original item cannot be found.
    I've searched the computer for the images, but they seem to be permanently deleted.  How do I "reset" iPhoto from looking for these photos and remove this "Alert"?
    Sincerely,
    Mark T

    mark, you are asking about iPhoto on your Mac, right? This is the iPhoto on IOS devices forum - iPads, iPhones, etc. Next time please post your question in the iLIfe iPhoto forum; you will get more help there.
    But to your question. This error message usually occurs, when original image files are missing from your iPhoto library. iPhoto keeps the original images and the edited versions, and when the originals are removed from the iPhoto Library by deleting them from the Finder, then the photos can no longer be edited, exported, printed.
    Does iPhoot open correctly, after the alert appears? Can you work with it, after the alert finishes? Then delete the corresponding edited versions of the missing originals from your iPhoto library. The versions probably will be marked by an exclamation point, when you browse your photos.
    To prevent this from happening again, open the iPhoto "Preferences" > "Advaced" panel and make sure the option "Importing: Copy items to the iPhoto LIbrary" is enabled. Otherwise original files may be stored outside your iPhoto library and you can accidentally delete them and loose valuable photos.
    Regards
    Léonie

  • The cryptic error - element cannot be found in a collection ?

    I have encountered this error in the script task a few times. The causes are - Variable is present in code,  but not added to task list OR, you try to create a DataColumn with the wrong column name, OR the variable in the task list has been deleted.
    When you make such mistakes, you get the cryptic error - 
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. 
    ---> Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not there.
     ---> System.Runtime.InteropServices.COMException (0xC0010009): The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not
    there.
    How do I guess the EXACT source of the problem from this cryptic error message ?
    I am sure that I am a beginner compared to the developers who made SSIS. But, what amazes me is that they could not even show which element was missing ? As a result, the developer has to look at all the variables in his code and see if they are in the list.
    Is this error so cryptic in even SSIS 2012 ? This should not have been too hard for the highly paid programmers to figure out.

    The thing is the variables are stored as an array or to be precise a collection so the variable name is the key and as you might have noticed in other programming languages that the values are not displayed in the error or the stack trace so according to
    the base engine the variable name is just a string value and nothing more so it will throw the error 
    "The element cannot be found in a collection"
    instead of showing which which variable.
    Surender Singh Bhadauria
    My Blog

  • Variable not found when package executes.".The element cannot be found in a collection."

    This is a very simple tutorial demonstrating script task. 2 variables
    intvar int32 5
    strvar string 0
    And a script task with this code
    If Dts.Variables("intVar").Value > 10 Then
                Dts.Variables("strVar").Value = "Big"
            Else
                Dts.Variables("strVar").Value = "Small"
            End If
            MsgBox(Dts.Variables("strVar").Value)
    below is the error msg
    SSIS package "Package.dtsx" starting.
    Error: 0x1 at Script Task: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: The element cannot be found in a collection. This error happens when
    you try to retrieve an element from a collection on a container during execution of the package and the element is not there.
     ---> System.Runtime.InteropServices.COMException (0xC0010009): The element cannot be found in a collection. This error happens when you try to retrieve an element from a collection on a container during execution of the package and the element is not
    there.
       at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSVariables100.get_Item(Object Index)
       at Microsoft.SqlServer.Dts.Runtime.Variables.get_Item(Object index)
       --- End of inner exception stack trace ---
       at Microsoft.SqlServer.Dts.Runtime.Variables.get_Item(Object index)
       at ST_ce37649a37c146518fa69eff106c6625.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
    Task failed: Script Task
    Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches
    the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
    SSIS package "Package.dtsx" finished: Failure.
    The program '[2824] Package.dtsx: DTS' has exited with code 0 (0x0).

    Must be a typo in variable name (not matching declaration)
    Arthur My Blog
    there is one more reason for the problem - 
    I had the code
    DataColumn dc = null;
    dc = myDataTable.Columns["PERSON_NAME"];
    The column to be fetched was NAME and not PERSON_NAME...someone changed it in the db :(

  • Iphoto wont open,keep getting Alert:The photo IMG_3515.jpg could not be opened,because the original item cannot be found. It opened fine two days ago. Any suggestions? iPhoto 9.3.2

    iphoto wont open,keep getting Alert:The photo IMG_3515.jpg could not be opened,because the original item cannot be found. It opened fine two days ago. Any suggestions? iPhoto 9.3.2

    No changes were made. I saw in one of the threads where someone said to repair the database(which didn't work) or Rebuild the database(which did work). Thanks to one all for the support.
    WP

  • Photo could not be opened, because the original item cannot be found

    I've drawn a blank. This error message gets touched on in places, but I cannot find a direct answer.
    I have never used iPhoto.
    After installing and without changing any settings, I got to import folder.
    I select my photos folder and begin to import all my photos.
    Every single photo of the 3500+ pops up the error:
    "The photo "xxx.jpg" could not be opened, because the original item cannot be found"
    And I have to press Cancel (and then it imports it anyway) for each of the 3500+ photos.
    What is going on?
    I need to employ a chimp to press Cancel thousands of times...
    I have not imported, deleted, moved or done anything. Apart from install iPhoto and then IMPORT.
    TIA

    Welcome to the Apple Discussions.
    Try this
    To create and populate a new library:
    Note this will give you a working library with the same Events and pictures as before, however, you will lose your albums, keywords, modified versions, books, calendars etc.
    In the iPhoto Preferences -> Events Uncheck the box at 'Imported Items from the Finder'
    Move the iPhoto Library to the desktop
    Launch iPhoto. It will ask if you wish to create a new Library. Say Yes.
    Go into the iPhoto Library (Right Click -> Show Package Contents) on your desktop and find the Originals folder. From the Originals folder drag the individual Event Folders to the iPhoto Window and it will recreate them in the new library.
    When you're sure all is well you can delete the iPhoto Library on your desktop.
    In the future, in addition to your usual back up routine, you might like to make a copy of the library6.iPhoto file whenever you have made changes to the library as protection against database corruption.
    Regards
    TD

  • I am trying to download photos from my camera to iphoto on my mac book (which I have done many times before).  This time I am getting an alert that saysThe photo "IMG_5965.JPG" could not be opened, because the original item cannot be found.  Help?

    I am trying to download photos from my camera to iphoto on my mac book (which I have done many times before).  This time I am getting an alert that saysThe photo “IMG_5965.JPG” could not be opened, because the original item cannot be found.  How can I fix this?

    There is a fair likelihood of an explanation of this symptom
    in another ASC discussion thread; see the reply by léonie:
    https://discussions.apple.com/message/20165563#20165563
    You may have to research any newer possibilities in trouble-
    shooting or resolving issues by use of iPhoto Support page.
    Since I don't use iPhoto as a primary editor or storage, the
    details on the topic aren't so good. I prefer ToyViewer editor.
    •iPhoto Support
    •iPhoto Video Tutorials
    Hopefully the error is easily corrected.
    Good luck & happy computing!

  • Re: how do I solve this alert-The photo "evaluation.jpeg" could not be opened, because the original item cannot be found.

    Re: how do I solve this alert-The photo “evaluation.jpeg” could not be opened, because the original item cannot be found. How do I get rid of the alert so that every time I open iphoto or sync my iphone it will not come up anymore.
    Thanks

    The issue is with iPhoto. When it opens it is looking for a photo that either no longer exists or is misplaced. I would post I the iPhoto forum where those experts are.

  • How do I solve this alert-The photo "evaluation.jpeg" could not be opened, because the original item cannot be found.

    it happened when I did an update on the iphoto
    how do I solve this
    alert-The photo “evaluation.jpeg” could not be opened, because the original item cannot be found.

    The issue is with iPhoto. When it opens it is looking for a photo that either no longer exists or is misplaced. I would post I the iPhoto forum where those experts are.

  • Iphoto update "The photo "X" could not be opened, because the original item cannot be found."

    Updating iphoto and get the Alert "The photo “X” could not be opened, because the original item cannot be found." Which is because I have archived thousands of photos offline. I can't go through the entire list one by one hitting the "cancel" button, but iPhoto apparently won't update unless this is done. Is there a way to skip this step? I can't run iPhoto at all with the alert live.
    Mac OS X 10.9.2

    Do you have a referenced library (The iPhoto advanced preference to "copy imported items to the iPhoto library" has been unchecked) which is strongly NOT recommended.
    If so then your only choice is to restore the originals back to the exact path they had when you imported them or to rebuild your library using iPhoto Library Manager - http://www.fatcatsoftware.com/iplm/ -  without them
    LN

  • Help - photo could not be opened, because the original item cannot be found

    I keep getting the following error message for about 10 different photos:  "The photo “IMG_0123.JPG” could not be opened, because the original item cannot be found."  It prompts to cancel or find these photos every time I open iPhoto.  Is there any way I can stop this.  I don't know if I still have the photos and, at this point, I don't care.  I just want it to stop.  Thanks in advance for any advice.

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    Regards
    TD 

  • "The photo "EGY_7895.jpg" could not be opened, because the original item cannot be found"

    I'm getting the following message when I click on any photo in my most recent import: "The photo “xxx.jpg” could not be opened, because the original item cannot be found". The thumbnails are in iphoto but it dosen't seems to reconize the files when I try to go in to edit. I have iphoto version 8.1.2. Help please.

    Are you running a Managed or a Referenced Library?
    A Managed Library, is the default setting, and iPhoto copies files into the iPhoto Library when Importing. The files are then stored in the Library package
    A Referenced Library is when iPhoto is NOT copying the files into the iPhoto Library when importing because you made a change at iPhoto -> Preferences -> Advanced. (You unchecked the option to copy files into the Library on import) The files are then stored where ever you put them and not in the Library package. In this scenario you are responsible for the File Management. 
    It sounds like this batch of photos were imported as Referenced.
    Regards
    TD

  • Question Mark - "The item cannot be found" at top of folders

    When I open any of my desktop folders and my HD, there is a question mark at the top right-hand side. When I click on it, a message saying "The item cannot be found". Any ideas as to what might be causing this?
    Ohhhh, please don't tell me my HD needs replacing and I'll have to wait a MONTH for my Mac to come back home...
    Thanks!

    These threads might be helpful:
    http://discussions.apple.com/thread.jspa?messageID=1529275&#1529275
    http://discussions.apple.com/thread.jspa?messageID=3093153&#3093153
    15" MacBook Pro 2.16 GHz (Core 2 Duo) Mac OS X (10.4.8) , Mac Mini 1.66 GHz   Mac OS X (10.4.8)  

  • Original item cannot be found?

    I have sent several videos from my phone to my computer via email. I saved the videos to a folder on my desktop. Originally all the videos played. However, now I am getting an error message on about half of them which states: "The alias 'blah blah' could not be opened because the original item cannot be found." with options: Delete Alias, Fix Alias, OK. If I click ok, it does nothing. If I click Fix Alias, it turns it into a file folder and I can't figure out how to change it back. If I click Delete Alias, it deletes the video. How can I get my videos back? I've tried renaming the HD to see if that had changed, but it doesn't seem to matter. Any help would be appreciated.

    Did you move the folder or the videos in it?
    Then the alias will not be able to find its parent.
    If you did, just create new aliases.

Maybe you are looking for