Solved

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

Posted on 2006-06-18
4
234 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
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can not run ASP pages Windows 10 Edge browser. 5 107
Why Bundles is not working on certain files - ASP MVC 3 60
Using Classic ASP inside HTML pages 2 62
Index on a Table 6 25
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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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