Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 4th, 2005, 12:04 PM
Authorized User
 
Join Date: Jan 2005
Location: ipaja, lagos, Nigeria.
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to p2ptolu Send a message via Yahoo to p2ptolu
Default this page can not be displayed "error"

this page does not go to the session(msg) what could be wrong.

code below:


Set oConn = Server.CreateObject("ADODB.Connection")
    oConn.Open application("dbaseConn")
    Set oRset = Server.CreateObject("ADODB.Recordset")
    Set oRsetA = Server.CreateObject("ADODB.Recordset")
    strSql = "SELECT * FROM qryContentTheCompanyLocationsList3 WHERE Id = " & intId
    oRset.Open strSql, oConn, adOpenStatic, adLockOptimistic

    'get previous item having this same position, if any
    strSql = "SELECT Id FROM qryContentTheCompanyLocationsList3 WHERE ListPosition = " & intListPosition & " AND Id <> " & intId
    'strSql = " SELECT Id FROM "
    oRsetA.Open strSql, oConn, adOpenStatic, adLockOptimistic

    'get title
    'strTitle = strTitle

    'add/edit data
    strUpdateType = "edited"
    intUpdateType = 2
    if oRset.eof then
        oRset.AddNew
        strUpdateType = "added"
        intUpdateType = 1
    end if

    oRset("Title") = strTitle
    oRset("Address") = strAddress
    oRset("Phone") = strPhone
    oRset("Fax") = strFax
    oRset("EmailAddress") = strEmailAddress
    oRset("ListPosition") = intListPosition
    oRset.Update


    'get Id of new or added item
    intId = oRset("id")
    oRset.Close

    'adjust positions, if need be

    intPositionAdjust = intListPosition 'get requested position
    do while not oRsetA.eof
        intOldPositionItemId = oRsetA("id") 'get id of item previously having this position
        oRsetA.Close
        intPositionAdjust = intPositionAdjust + 1 'increment order no

        'increment position of item previously having this position
        strSql = "UPDATE qryContentTheCompanyLocationsList3 SET ListPosition = " & intPositionAdjust & " WHERE Id = " & intOldPositionItemId
        oConn.Execute strSql

        'get id of any other item with incremented order no, if any
        strSql = "SELECT Id FROM qryContentTheCompanyLocationsList3 WHERE (ListPosition =" & intPositionAdjust & " AND Id <> " & intOldPositionItemId & ")"
        oRsetA.Open strSql, oConn, adOpenStatic, adLockOptimistic
    loop
    oRsetA.Close

    '-----update audit records - TypeId, ElementSectionId, ElementTypeId, ElementId, ElementTitle, EditorId, TimeUpdate
' strSql = "qryAuditUpdateAdd " & intUpdateType & ", 1, 3, " & intId & ", 'Locations: " & strTitle & "', " & CInt(session("UserId")) & ", " & CDbl(Now)

strSql = " SET IDENTITY_INSERT AuditUpdate ON INSERT INTO AuditUpdate(TypeId, ElementSectionId, ElementTypeId, ElementId, ElementTitle, UserId, TimeUpdate)VALUES ([TypeId], [ElementSectionId], [ElementTypeId], [ElementId], [ElementTitle], [UserId], CDate([TimeUpdate])); " & intUpdateType & ", 1, 3, " & intId & ", 'Locations: " & strTitle & "', " & CInt(session("UserId")) & ", " & CDbl(Now)
    oConn.Execute strSql

    'close data sources
    oConn.Close
    set oRset=nothing
    set oRsetA=nothing
    set oConn=nothing

    'display results
    session("msg") = "Success! <i>The Company Locations " & strUpdateType & "."
    response.Redirect("msg.asp")
%>
Reply With Quote
  #2 (permalink)  
Old July 4th, 2005, 01:03 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

I think a bit more information, other than a "solve this" instruction would really help.

Do you get an error? If so, what error message do you get? If you don't get an error, what behavior are you seeing?

It's a bit too much to ask for us to figure out what the problem is for you; but if you describe the problem, we might be able to help you.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old July 6th, 2005, 07:34 AM
Authorized User
 
Join Date: Jan 2005
Location: ipaja, lagos, Nigeria.
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to p2ptolu Send a message via Yahoo to p2ptolu
Default

Quote:
quote:Originally posted by Imar
 I think a bit more information, other than a "solve this" instruction would really help.

Do you get an error? If so, what error message do you get? If you don't get an error, what behavior are you seeing?

It's a bit too much to ask for us to figure out what the problem is for you; but if you describe the problem, we might be able to help you.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #4 (permalink)  
Old July 6th, 2005, 07:36 AM
Authorized User
 
Join Date: Jan 2005
Location: ipaja, lagos, Nigeria.
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to p2ptolu Send a message via Yahoo to p2ptolu
Default

It displays " THIS PAGE CAN NOT BE DISPLAYED PAGE"

Reply With Quote
  #5 (permalink)  
Old July 6th, 2005, 09:58 AM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

I know a little trick to find out exactly what the error is.

First, run the page to get the "PAGE CANNOT....." error.

Then select all of your code and type one letter on the page. Refresh the browser. You will see your one letter. Then do a Control + Z to get your code back and refresh the browser again. Most of the time an error will display with the offending line number.

Check it out.

Reply With Quote
  #6 (permalink)  
Old July 6th, 2005, 10:00 AM
Registered User
 
Join Date: Jun 2005
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
Your error seems to be comming as a result of syntax error in your code, scrowing down on the error page you see the line number which gives this error.

Reply With Quote
  #7 (permalink)  
Old July 6th, 2005, 04:54 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You're missing a MoveNext for the recordset. You're using "do while not oRsetA.eof" but since you never use MoveNext, Eof will never be true and the code loops forever. Or, in fact, it loops until the page times out and you get this error.

Would you mind posting questions on this forum, instead of sending me mail directly? I can't possibly answer all the mail I receive....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #8 (permalink)  
Old July 7th, 2005, 04:10 AM
Authorized User
 
Join Date: Jan 2005
Location: ipaja, lagos, Nigeria.
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to p2ptolu Send a message via Yahoo to p2ptolu
Default

The ERROR PAGE NOW HAS THIS BELOW:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure 'qryAuditUpdateAdd'.

/cms/contentthecompany/boardmanagementAddEditFn.asp, line 132


THIS STARTED YESTERDAY.BUT THE WEBSITE CHANGES ,IT UPDATES THE SITE AND THE CHANGES ARE VISIBLE BUT I DO NOT LIKE THIS ERROR MESSAGE BEING DISPLAYED.

Reply With Quote
  #9 (permalink)  
Old July 7th, 2005, 05:31 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

We can hear you load and clear; there is no need to shout ;) (Writing in ALL CAPS is considered shouting).

You are using Sql server, right? Are you sure you are connecting to the right database and that that database has a stored procedure: 'qryAuditUpdateAdd'??

Imar
Reply With Quote
  #10 (permalink)  
Old July 7th, 2005, 08:25 AM
Authorized User
 
Join Date: Jan 2005
Location: ipaja, lagos, Nigeria.
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to p2ptolu Send a message via Yahoo to p2ptolu
Default

yes i am connecting to a SQL server and i created that stored procedure, and lastly the script does what it is meant to do, but i do not want to see the error again.


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
mail send error :page cannot be displayed KamalRaturi ASP.NET 2.0 Professional 2 May 5th, 2008 10:59 AM
Unwanted error page displayed patwadd Classic ASP Basics 2 February 8th, 2005 10:07 AM
Terrible error: The page cannot be displayed csun ASP.NET 1.0 and 1.1 Basics 2 November 9th, 2004 10:16 AM
Error Message: The page cannot be displayed BSkelding ASP.NET 1.0 and 1.1 Basics 2 April 23rd, 2004 11:27 AM
the page cannot be displayed aspweb BOOK: Beginning ASP.NET 1.0 1 October 20th, 2003 07:41 PM



All times are GMT -4. The time now is 09:02 PM.


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