?
Solved

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

Posted on 2006-06-18
4
Medium Priority
?
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

764 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