 |
| 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 21st, 2004, 03:52 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Tickenumber represents numbers "Interger" yes their's a Escalation record with a ticket number.
|
|

July 21st, 2004, 03:58 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
So, did my suggestion work?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: You've Been Flirting Again by Björk (Track 6 from the album: Post) What's This?
|
|

July 21st, 2004, 04:10 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I would like explain where am getting ticknum from. I have a table that displays
Ticket numbers as a link and displays customer fnam, lname etc. Users click on the
links to edit records.
the output is
SQL is SELECT * FROM Escalation_Forms WHERE Ticket_Number = 18
|
|

July 22nd, 2004, 12:58 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
But does it work now? I see where you are getting at, but I just don't know if it's working now or not.
If the SQL statement looks good to you (it does look good to me), simply comment out the two lines I suggested earlier (Response.Write and Response.End) and try again.....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

July 22nd, 2004, 08:15 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No it didn't work! all have on the screen is :
SQL is SELECT * FROM Escalation_Forms WHERE Ticket_Number = 2
|
|

July 22nd, 2004, 11:49 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hey,
Remove or comment out the Response.End() (if you haven't already) to make sure that your system works. Also, make sure you don't have the quotes around the number as that will cause an error with an integer value.
Then try,
Brian
|
|

July 22nd, 2004, 11:58 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
I think you need to read a little better ;)
Quote:
|
quote:If the SQL statement looks good to you (it does look good to me), simply comment out the two lines I suggested earlier (Response.Write and Response.End) and try again.....
|
The Response.Write and Response.End lines were just there to debug your SQL statement. Once you remove them, the page will no longer stop at the Response.End line and execute your SQL statement.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

July 22nd, 2004, 03:48 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi thank you!
I was able to debug and re-arrange some of my code:
It submiting but I am getting the following error.
error Exception occurred. /forms/results.asp, line 90
Which is :
<option <%If ObjRS("Status")="" Then%>selected<%End If%>>Choose One</option>
Came form here:
<b>Status:</b><select name="Status">
<option <%If ObjRS("Status")="" Then%>selected<%End If%>>Choose One</option>
<option value="Open" <%If ObjRS("Status")="Open" Then%>selected<%End If%>>Open</option>
<option value="Pending Research" <%If ObjRS("Status")="Pending Research" Then%>selected<%End If%>>Pending Research</option>
<option value="Close" <%If ObjRS("Status")="Close" Then%>selected<%End If%>> Close</option>
</select>
Here's all my code: Please I am so close to finishing this project!
<%@ Language=VBScript %>
<%Option Explicit
%>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
</head>
<body>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="985" height="50" id="table1" bgcolor="#000000">
<tr>
<td width="983" height="50" align="center">
<img border="0" src="LogoMasthead.gif" align="left" width="150" height="45"><img border="0" src="header_level3.jpg" width="828" height="48"></td>
</tr>
</table>
</center>
</div>
<p align="center">
Updating
Records
<p align="left">
<%
Dim TicketNum, ObjConn, Conn, ObjRS, strSQL
TicketNum = Request.QueryString("TicketNum")
set objConn=Server.CreateObject("ADODB.CONNECTION")
ObjConn.Open "Provider=sqloledb;Data Source=Flmirsql02;Initial Catalog=Source_Forms;User Id=Source_Forms_User;Password=password;"
Set ObjRS = Server.CreateObject("ADODB.Recordset")
ObjRS.Open "SELECT * FROM Escalation_Forms WHERE Ticket_Number = ' " & TicketNum & "'", ObjConn, 3, 3
if ObjRS.eof then
response.write "no data"
ELSE
Response.Write"<br><b>Ticket Number:</b>" & objRS("Ticket_Number") & "<br>" &_
"<b>Status:</b>" & objRS("Status") & "<br>" &_
"<b>First Name:</b> " & objRS("First_Name") & "<br>" &_
"<b>Last Name:</b> " & objRS("Last_Name") & "<br>" &_
"<b>Customer Account Number:</b>" & objRS("Account_Number") & "<br>" &_
"<b>Customer Phone Number:</b> " & objRS("Phone_Number") & "<br>" &_
"<b>Tech Number:</b> " & objRS("Tech_Number") & "<br>" &_
"<b>Job Number:</b> " & objRS("Job_Number") & "<br>" &_
"<b>Custmer Comment:</b> " & objRS("Cust_Com") & "<br><br>"
'ObjRS.AddNew
'ObjRS.Fields("Status") = Request.Form("Status") & ""
'ObjRS.Fields("Wip_Com") = Request.Form("Wip_Com") & ""
'else
'ObjRS.Update
end if
%>
<form action=results.asp method = post style="text-align: center">
<b>Status:</b><select name="Status">
<option <%If ObjRS("Status")="" Then%>selected<%End If%>>Choose One</option>
<option value="Open" <%If ObjRS("Status")="Open" Then%>selected<%End If%>>Open</option>
<option value="Pending Research" <%If ObjRS("Status")="Pending Research" Then%>selected<%End If%>>Pending Research</option>
<option value="Close" <%If ObjRS("Status")="Close" Then%>selected<%End If%>> Close</option>
</select>
<p><b>Feed Back:</b>
<textarea name="Wip_Com" rows="5" cols="20"><%= ObjRS("Wip_Com") %></textarea></p>
<p>
<span style="vertical-align: middle; font-weight: 700">
<b>
<a href="http://sflsource/forms/Eta_database3.asp">Return to Main Page </a>
</b> </span> <input type="submit"; name=" Update_Database" value="Update Database">
<input type="hidden"; name="Status" value="Status">
<input type="hidden"; name="Wip_Com" value="Wip_Com">
<input type="hidden"; name="TicketNum" value="TicketNum">
</p>
</form>
<%
If request.form("TicketNum")<>"" Then
strSQL = "UPDATE Escalation_Forms SET Status='"& request.form("Status") &"', Wip_Com='"& request.form("Wip_Com") &"' WHERE Ticket_Number='"& request.form("TicketNum")&"'"
ObjConn.Execute strSQL
End if
ObjRS.Close
Set ObjRS = Nothing
ObjConn.Close
Set ObjConn = Nothing
%>
</body>
</html>
|
|

July 22nd, 2004, 04:16 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You seem to have code referencing the recordset *outside* the code block that creates and opens the recordset and checks for EOF.
So, when the recordset is empty, or the page loads for the first time, the recordset may not contain records, so you can't get its status field...
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Morning song by Perry Blake (From the album: California) What's This?
|
|

July 23rd, 2004, 03:13 PM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am able to get to recognize the number but when I submit I am getting the following error: Here's what it displays:
SQL string is:SELECT * FROM Escalation_Forms WHERE Ticket_Number = '12'CODE TO DISPLAY RECORD
Ticket Number:12
Status:Open
First Name: marjorie
Last Name: miligan
Customer Account Number:8495640025478951
Customer Phone Number: 954-534-7312
Tech Number: 5
Job Number: 987
Custmer Comment: Testing again1
Status:
Feed Back: test
The error I am getting when submiting or trying to update database.
ADODB.Field error '80020009'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/forms/results.asp, line 0
|
|
 |