My code won't run on another PWS

Results 1 to 2 of 2

Thread: My code won't run on another PWS

  1. #1
    Join Date
    Dec 1969

    Default My code won't run on another PWS

    I have created a simple log in page which I have completed (sorry) in Ultra Dev, creating a DSN connection as UD does with my database - I have then sent this to a company who run PWS on win98, they are having problems setting this up on their system, the common error they are getting is <BR><BR>ADODB.Fields error &#039;800a0cc1&#039; <BR><BR>Item cannot be found in the collection corresponding to the requested name or ordinal. <BR><BR>/OH_quote/login.asp, line 103 <BR><BR>error on fron screen<BR><BR>Response object error &#039;ASP 0156 : 80004005&#039; <BR>Header Error <BR>/OH_quote/users.asp, line 70 <BR>The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content. <BR><BR><BR>here is the code which has be written<BR><BR>&#060;%<BR>&#039; *** Validate request to log in to this site.<BR>MM_LoginAction = Request.ServerVariables("URL")<BR>If Request.QueryString&#060;&#062;"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString<BR>MM_valUsername=CStr(Request .Form("Username"))<BR>If MM_valUsername &#060;&#062; "" Then<BR> MM_fldUserAuthorization=""<BR> MM_redirectLoginSuccess="users.asp"<BR> MM_redirectLoginFailed="failed.asp"<BR> MM_flag="ADODB.Recordset"<BR> set MM_rsUser = Server.CreateObject(MM_flag)<BR> MM_rsUser.ActiveConnection = MM_ConnOPHOL_STRING<BR> MM_rsUser.Source = "SELECT colUSERNAME, colPASSWORD"<BR> If MM_fldUserAuthorization &#060;&#062; "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization<BR> MM_rsUser.Source = MM_rsUser.Source & " FROM tabLOGIN WHERE colUSERNAME=&#039;" & MM_valUsername &"&#039; AND colPASSWORD=&#039;" & CStr(Request.Form("Password")) & "&#039;"<BR> MM_rsUser.CursorType = 0<BR> MM_rsUser.CursorLocation = 2<BR> MM_rsUser.LockType = 3<BR> MM_rsUser.Open<BR> If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then <BR> &#039; username and password match - this is a valid user<BR> Session("MM_Username") = MM_valUsername<BR> If (MM_fldUserAuthorization &#060;&#062; "") Then<BR> Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization ).Value)<BR> Else<BR> Session("MM_UserAuthorization") = ""<BR> End If<BR> if CStr(Request.QueryString("accessdenied")) &#060;&#062; "" And true Then<BR> MM_redirectLoginSuccess = Request.QueryString("accessdenied")<BR> End If<BR> MM_rsUser.Close<BR> Response.Redirect(MM_redirectLoginSuccess)<BR> End If<BR> MM_rsUser.Close<BR> Response.Redirect(MM_redirectLoginFailed)<BR>End If<BR>%&#062;<BR><BR>I have placed this to the bottom of my code after reading the articles at Microsoft web site.<BR><BR>is there something simple that they are not doing or I have done

  2. #2
    Join Date
    Dec 1969

    Default NO, NO, NO, NO!

    Another example of copy-and-paste getting everyone into trouble...<BR><BR>Look, the code which has "been written" was generated by Ultradev. It&#039;s ugly, but it should work. However, it requires several things:<BR>1) To be AT THE TOP OF THE PAGE -<BR>2) A connection to the SAME DATABASE - you aren&#039;t selecting all the fields you need, or the field does not exist in the database...<BR><BR>Try breaking down these problems into their component parts/errors and searching for them - they are VERY VERY common.<BR><BR>I think it being PWS makes no odds. The code is at fault, not the OS.<BR><BR>Craig.

Posting Permissions

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