Trying to return a Recordset to an ASP and the Recordset is empty.
The StorredProc works in the query analyzer and it even works from a
quick VB app that I wrote to test it.
The storedproc that I am using is fairly complex (creates some
temporary tables and populates them with 'Insert Into Select ...', but
the during testing the only Select statements that return visible rows
is the final one that returns the finished table with an 'Order By
....'.
I am trying to figure out if I am receiving multiple recordsets or if
I am out of environment space. Do the 'Insert Into Select ..'
statements return empty or null recordsets ?
The following query returns one row when run in Query Analyzer:
DECLARE @IntCnt AS integer SET @IntCnt = 0 SELECT @IntCnt = @IntCnt + COUNT(DISTINCT B.ServiceID) FROM dbo.TblServices A INNER JOIN dbo.TblOccurences B ON A.ServiceID = B.ServiceID WHERE ({ fn LCASE(A.Prim_Sec) } = 'primary') AND (B.[Sort Date] > GETDATE()) AND (A.Assessment = 1) GROUP BY B.ServiceID SELECT 'Assessment' AS Whatever, @IntCnt AS Totals
How ever, if I run the same query in Enterprise Manager, or within an ASP script, no rows are returned.
I'm trying to deal with a few records in a db that are missing data in one or more fields, which breaks my page, causing a BOF or EOF error, since the recordset is empty. I can check for an initial EOF, before any traversing of the records, but don't know how exactly to bypass execution of the record accessing from there.
It works fine, but sometimes the Subject Name field is empty, so instead of a blank space, I'd like to put something like "Empty Recordset" there. Is there anyway to do this with my current code?
how do you check if a recordset is empty? i am trying to write a code that checks in the database if a field is empty and if it is, it should equal to "No." . here's what i have so far:
If rs("contact")="" then rs("contact")="No" Else rs("contact")=rs("contact") End If
I am getting this error:
ADODB.Recordset (0x800A0CB3) Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
i want to test if a recordset is empty then print a sentence Else display the records. i tried if recordset.recordcount = 0 then ..... else and it aint working. i want to use it for a delete.asp page cuz when the table is empty it throws an error.
I'm calling a SQL stored procedure with the folowing code. It seems to work fine but I want to know if it doesn't return any rows and the oRsCatList. eof is not working.
lcDisplayCatList = "Y" Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open Session("strConn") Set oCmd = Server.CreateObject("ADODB.Command") set oCmd.ActiveConnection = oConn oCmd.CommandText = "spCategoryList" oCmd.commandtype = AdCmdStoredProc oCmd.Parameters.Append oCmd.CreateParameter("@CatID", adInteger, adParamInput) oCmd.Parameters("@CatID") = lnCatID set oRsCatList = oCmd.Execute if oRsCatList.EOF then lcDisplayCatList = "N" end if
I have a results page with two result boxes and am trying to add 'Show if recordset is empty' for obvious reasons (in Dreamweaver Mx). BUT i've highlighted text (eg, criteria error) for one and used the show if....
which works fine but when i try to add it to the second box (different recordset) it doesn't work, WHY?? Just trying to show a message in case no box is filled or no data retieved on the query of the record set.
The structure of my app allows for creating sections inside of a topic. The sections have an order in which they are displayed. To create a section in a topic that has no sections I need to query the database to get the top order of the sections so the new section created will be at the bottom (thus having the highest section order number). If there is an null set returned then The new section has an order of 1.
I can insert sections if there are other sections associated with the same topic inside of the table, but cannot set an initial order number if there are no section associated to that topic. Please help. I have tried checking against EOF and BOF and null and and an empty string and feel like baching my head against a wall.
Below is code to display in a drop down menu some addresses. There is two things i need to do. One is to not show if there are no records but also there could be duplicate records, How do i stop duplicates occuring...
I have created the following code to create the recordset rsToBeApprovedLocalItemID. Unfortunately, the for next loop works properly only on the first cycle. The response.write(arrToBeApprovedCatSub(0)&arrToBeApprovedCatSub(1)&"<br>")works for each loop but the SQL statement sqlToBeApprovedLocalItemID returns a populated recordset only on the first loop.
On subsequent loops it is empty even though the arrToBeApprovedCatSub(0) and arrToBeApprovedCatSub(1) are alive and well. What's going on? This is truly weird behaviour. I have not come across something this funky before. Code:
I´m making a asp page which creates a xml-file. The values for the xml-file will be calculated in a stored procedure. This procedure returns 3 recordsets. In my query analyser the stored procedure returns the right values. The problem on my asp page is that the stored procedure is executed, but the recordset is empty.
This is the error message from my internet explorer: ADODB.Recordset (0x800A0CC1) Item cannot be found in the collection corresponding to the requested name or ordinal.
Last week, my shopping cart was still working well until I began getting the following errors 2days ago..
Error Type:
ADODB.Recordset (0x800A0BCD) Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. ../order/saveorder.asp, line 157
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Page: GET /main/saveorder.asp
Could you check my code below and let me know what possibly the error is?
I've created a DLL file that enables you to validate accounts and send emails through the MS Exchange server within the Intranet. This dll can be used from within VB, VBA, VBScript and also ASP VBScript. I'm using it in an ASP page that I've created. The DLL has a "SEND" function that will return a string value containing all the invalid accounts seperated by a semi-colon. A sample of the returning string value would look like, "InvalidAcct1;InvalidAcct2;InvalidAcct3". The DLL works like it is suppose to when used in an ASP, but it will not return the string value. I know the DLL works fine because it returns it when used in a regular VBScript or VB program.Is IIS preventing the string from being returned?
I am using a windows 2000 server with IISLockdown and ISAPI_Rewrite installed on it. I have 2 websites A & B. ASP pages on A are working properly, but when placed one B they return 404 error. All other pages such as txt, html, asp.net work fine on B. Both websites have the same configuration, and use the same ISAPI filters.
A sample cade the is not working is, file name test.asp: <%@ LANGUAGE="VBSCRIPT" %> <% response.redirect("http://www.cnn.com")%>
There are two pages main.asp and phonebook.asp.In the main.asp, there is a textfield, where the phone number will be inserted into it. Next to the textfield, there is an icon that when clicked takes you to the phonebook.asp page.
In the phonebook.asp page, there is a list of the telephone numbers and next to them there is a radiobutton. When one of the radiobuttons is chosen (the telephone number is chosen), the number (value) needs to be inserted in the textfield (main.asp page).How may i do this processing? Preferably i need to use asp together with vbscript or even javascipt.
I am using a windows 2000 server with IISLockdown and ISAPI_Rewrite installed on it. I have 2 websites A & B. ASP pages on A are working properly, but when placed one B they return 404 error. All other pages such as txt, html, asp.net work fine on B. Both websites have the same configuration, and use the same ISAPI filters.
A sample code that is not working is, file name test.asp: <%@ LANGUAGE="VBSCRIPT" %> <% response.redirect("URL")%>
I have a MS SQL 7.0 table with a large field (> 500 characters). My select statement embedded in my ASP file in an intranet web interface only returns 255 characters. If I run the select statement in Query Analyzer, I can easily change the "Maximum Characters per Column" setting to return the entire field, but that doesn't help me in my ASP web interface. How do I return the entire field through ASP?
I have a form page a user needs to fill out. I want to be able to send the user back to the form once it is submitted and an error in processing occurs, for example if they have an illigal charcter in the form somewhere. The whole form wouldn't need to be retyped, just the field in question.
How can I send the user back to the form they just submitted to correct an entry?
I am passing a XML to SP, and SP in return send XML back. When I comment out sp_xml_preparedocument (XML reading block) in SP, ASP is taking returning XML as valid, but, if I uncomment input XML reading block, ASP is giving following error: Code:
Set RS=CN.Execute("INSERT into tableX yada yadayada ; SELECT SCOPE_IDENTITY()")
Using Profiler, I see the statement go through. But ASP gives me an error saying RS is not an object. "Operation is not allowed when the object is closed."
In these lines if not RS.EOF then theNewId=RS.Fields(0) end if
If I run the same query in QueryAnalyzer, I do get a return value.
I've got a site with PayPal and Google Checkout payment options. The checkout page formats two HTML forms, containing bespoke cart code - one posts to PayPal, the other to Google Checkout.When an order is placed, it needs to be updated back on my site, so that the order is marked as 'paid' in the database. When this is done with PayPal, I just provide a hidden field in the form called 'invoice' containing my id number for that transaction. This is returned in my IPN, and I update the database accordingly. However, I can't find a similar field in Google. Their example code all seems to be in XML and is WAAAAAAAAY more complicated than I need it to be. I just need to send a value with my cart code to Google Checkout, and have that value returned after the transaction has completed. I've set up Google Callback, and the page is being called and the order is being written to my google log txt file, I just need this to contain my order id number for the transaction so I can just add the logic to update the database based on this id number.
I have a table that has ticket number displays as a link.When I click on a ticket number it displays no data was return. (" it's not reading the ticket number I choose")Can someone look over my codes and tell me what should be doing! I am a the final part and I lost.
I have written some ASP code that selects some records from a SQL database according to a criteria, if no information is found in the database then it sees there is an End Of File in the object record set and prints the line below:
<%if objRecordset.EOF then Response.Write("No information was found for the record you have entered") %>
My problem is that if no records are found it still tries to print the information that it is looking for and cannot find and thus throws an exception. The code for that is below:
<Table Border="1" BGCOLOR="white">
<% Response.Write "<TR><TD>The date for that record is " & objRecordset("DateTime") & "<br></TD></TR>" %>