 |
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

July 4th, 2005, 12:04 PM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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")
%>
|

July 4th, 2005, 01:03 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|

July 6th, 2005, 07:34 AM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

July 6th, 2005, 07:36 AM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
It displays " THIS PAGE CAN NOT BE DISPLAYED PAGE"
|

July 6th, 2005, 09:58 AM
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
|
|
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.
|

July 6th, 2005, 10:00 AM
|
Registered User
|
|
Join Date: Jun 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

July 6th, 2005, 04:54 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|

July 7th, 2005, 04:10 AM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

July 7th, 2005, 05:31 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

July 7th, 2005, 08:25 AM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|
 |