Solved

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

Posted on 2006-06-18
4
230 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 500 total points
Comment Utility
Public Function getDataset(strSQL)
    set  getDataset = DBConn.Execute(strSQL)
End Function

this will  do
0
 
LVL 11

Expert Comment

by:kelvinwkw
Comment Utility
to assign an object to a variable you need to use SET

SET <variable> = object
0
 
LVL 11

Expert Comment

by:kelvinwkw
Comment Utility
Forgot to write down something that is needed

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

Author Comment

by:w3digital
Comment Utility
Marvellous!

Thank you very much indeed!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now