?
Solved

Can I use a function to return a recordset in classic ASP

Posted on 2006-06-18
4
Medium Priority
?
252 Views
Last Modified: 2008-02-01
I've recently switched from ASP to ASP.NET but I currently working on site that uses ASP.

In .NET I can use a DAL layer class and return a dataset to an object. I'm trying to do the same in ASP.

So, forgetting the classes etc and simplifying the matter I basically just need something like:

rsData = getDataset("SELECT * FROM table")
If Not rsData.Eof Then
         'Do my thing...
End If

Public Function getDataset(strSQL)
      getDataset = DBConn.Execute(strSQL)
End Function

I get "Object doesn't support this property or method: 'Eof'" so I guess I can't return a dataset.


0
Comment
Question by:w3digital
  • 3
4 Comments
 
LVL 11

Accepted Solution

by:
kelvinwkw earned 2000 total points
ID: 16931493
Public Function getDataset(strSQL)
    set  getDataset = DBConn.Execute(strSQL)
End Function

this will  do
0
 
LVL 11

Expert Comment

by:kelvinwkw
ID: 16931495
to assign an object to a variable you need to use SET

SET <variable> = object
0
 
LVL 11

Expert Comment

by:kelvinwkw
ID: 16931504
Forgot to write down something that is needed

set rsData = getDataset("SELECT * FROM table")
0
 

Author Comment

by:w3digital
ID: 16931542
Marvellous!

Thank you very much indeed!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month13 days, 20 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question