Returning A Recordset In A Function

I am having some troubles returning a recordset in a function. function: Code:

View Replies


ADVERTISEMENT

Returning Values - Which Is Faster? ByRef Sub Or Value-returning Function

What is a faster/better coding practice?

Method 1:

Code:
Sub myFunction(byRef x)
x = x + 1 ' do something with x
End Sub

x = 7
myFunction(x)
response.write x ' shows 8
Method 2:

Code:
Function myFunction(x)
myFunction = x + 1 ' do something with x
End Function

x = 7
response.write myFunction(x) ' shows 8

Also discuss considerations when there are more than one variables that need to be changed.

View Replies View Related

Returning RecordSet To ASP Is Empty

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 ?

View Replies View Related

RecordSet Not Returning Rows

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.

View Replies View Related

Returning A Value From A Single Function

I would like to know if I can some set a variable to return a single value
from a function using the set command. Is this possible? Code:

View Replies View Related

Returning The Results Of A Function

I have a function displaySiteMemberName(varSiteMember) that pulls the name of a member from the database. I also have a function displayThreadComments(threadID) which displays a little text and then the members name.

However, I can't get it to display on the same line. I'm assuming that its a problem using the response.write but I don't know how to return a value from a function. Code:

View Replies View Related

Returning Multiple Values From A Function

I've looked around the net and searched this message board and haven't been able to find a solution to this problem. An application that I am currently making pushes and pulls data from SQL. One stored procedure is very important and returns many values.

I call this sp many times in my script and wanted to put it in easy to manage function, sub, or whatever works. The problem is that it returns about 10 values that I would need to return from the function back to the standard asp. Code:

View Replies View Related

Closing Objects After Returning Value In Function ??

I am maintaining some code and I see in some functions..

Function myFunction

set someobj = Server.CreateObject("MYOBJ")
.....
....
set myFunction = "somedataToReturn"
set someobj = nothing

End Function

View Replies View Related

Returning Multiple Values From VBScript Function

I am using both VBScript and JavaScript functions in the same ASP file. All I need to do is to retrieve some values which are calculated in the VBScript function, to JavaScript. The call to the VBScript function is made through a JavaScript function. Code:

View Replies View Related

VBScript Function Returning Multiple Values

Is there a way to return multiple values from a function without using an
array? Would a dictionary object work better? Code:

View Replies View Related

Disconnected Recordset In Function Not 'SET'ing

I'm trying to encapsulate a disconnected recordset in a function, but I'm unable to shift the recordset object to the Function variable. I close the Function's recordset and database connection, and in my main page, I lose the data. Here's the function: Code:

View Replies View Related

Function/class Like As Recordset Object

i need a object/class/function that return me a array/object like this:

set oDataFromSQLServer = function_or_class(sql)

while oDataFromSQLServer.eof
value = oDataFromSQLServer("colum_name") oDataFromSQLServer.next

next

ps: I donīt want to use a Recordset in this case.
ps2: I don't want to use GetRows in this case, because it doesn't pertmit "string index" like array("columName")

View Replies View Related

Sending ASP ADO Recordset Value To Javascript Function

I am working on an ASP (3.0) page that displays hotel data from a recordset in a table. In the last column of each row, I want to include a button that will send the address information of this hotel to mapquest to display the map. I have tried several methods for sending this info, but nothing seems to work.

Here is my code for the javascript function I am calling: Code:

View Replies View Related

Error Type: ADODB.Recordset (0x800A0BADODB.Recordset (0x800A0BCD)

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?

View Replies View Related

SP Returning XML

Can someone give me an example of how to use a
stored procedure that returns XML data?

I want to call the SP from a VBScript program,
and put the XML into a data island in the generated HTML.

View Replies View Related

Returning Value

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?

View Replies View Related

Returning 404

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")%>

Do you know what needs to be done to fix that?

View Replies View Related

Returning A Value

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.

View Replies View Related

Returning 404

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")%>

Do you know what needs to be done to fix that?

View Replies View Related

SP Returning XML

Can someone give me an example of how to use a stored procedure that returns XML data?

I want to call the SP from a VBScript program, and put the XML into a data island in the generated HTML.

View Replies View Related

Returning Only 255 Characters

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?

View Replies View Related

Returning To A Form

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?

View Replies View Related

ASP Says Returning XML Invalid

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:

View Replies View Related

Returning Identity.

I tried the following:

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.

Am I missing something?

View Replies View Related

Returning Records

I have a seach function and I need to be able to only return records that begin with numbers.

SELECT * FROM [Tbl_Table] Where name LIKE '0-9%'

View Replies View Related

Returning Order Id

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.

View Replies View Related

Returning Date

I have a field that is stored in SQL Server in date/time format. On one
page, I only need the date to display. I am able to do this by saying:

DateValue(strLastModified)

However, this returns to me the date in this format:

05/10/2004

Instead, I would like to see:

05/10/04, but I am not sure how to do this.

View Replies View Related

Returning 0 Data

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.

View Replies View Related

Returning SQL Data

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>" %>

View Replies View Related

Returning Only 100 Rows

I was wondering if anybody could advise me how to return just 100 rows from a database query. In Cold Fusion I'd use the maxrows function, but not sure how to do in ASP (or can I do it in just SQL?). My code is thus :

' Retrieve last 100 records. Query then run through the query building a string
Set objRetrieve = objConn.Execute("SELECT Players_ID, Players_Name, Players_Score FROM Players ORDER BY Players_Score DESC")

View Replies View Related

Not Returning Records When It Should

I'm back with the same code, which works fine, except for when i ad the block of code that i noted...i get the error message:

ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/test/testbasket.asp, line 72

which is referring to the strSurvID=adoRSWEBtest4(0)

i know that the query above that is supplying webtest4 with its where check is returning a value. when i take out the noted block of code, the page works fine, and emails all information, including the value that is being checked for in webtest4. Code:

View Replies View Related

Sub Returning Values

I was under the impression (according to all the tutorials) that a Sub differs from a Function in that it doesn't return a value. Therefore I interpret this as meaning if a function is initialised at the top of a page and called at the bottom the result won't be returned to the place it was called i.e. the bottom of the page.

This clearly isn't right though as both Functions and Subs return a value to where they are call from.I want to display the results of a task in a position on the page that is before the task has been carried out.

Therefore if I create a Sub where I want the result to be displayed I assumed that when I call the Sub it would display the results where I wanted i.e. above the task. This isn't happening?

View Replies View Related

Returning One Character

i have a string that will change and i just want to return the first charecter, how do i do this?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved