Solved

For Wizard2 - Need clarification re:  SQLExec(), etc.

Posted on 1998-07-23
2
142 Views
Last Modified: 2012-05-04
I apologize, as re-reading my question and your answer leads me to believe I didn't phrase the question right.  I appear to be able to successfully connect to the database, and have set up the SQLCmd() and SQLExec appropriately.  I just can't figure out how to deal with the query results.  

Previously, I'd been able to route all the results of the query into the new recordset by setting the database and then using that database as part of the definition for the new recordset.  (' Set db = (....)', and then 'Set gSrchSet = db.OpenRecordset(....)')

How do I do that now?  In all the examples in the books, it seems to only reference 'results%' which is an integer, not a database or a recordset. (Plus they don't seem to ever show examples of what to do with any data that's returned, but that's another story!)  Is it that I can no longer 'set' the database?  If I can't do that, how do I define the recordset to hold the results of the query?

I'm just really stuck.  I do appreciate your original answer, and I'm hoping you understand why I'm still stuck.  Sorry if this isn't the right way to contact you, but I didn't see anywhere in the grading sheet where I could reply to the expert.

Thanks again!      
0
Comment
Question by:BooH
[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
  • 2
2 Comments
 
LVL 1

Expert Comment

by:wizard2072098
ID: 1466518
Unfortunately, when you deal directly with SQL, you're stuck not having recordset capability. The recordset is being maintained by the server, which is why you only have a "results%" integer. DAO, RDO, and ADO wrap the results into a recordset that allows you more freedom in the way you work with the records. With direct SQL, you'll have to use SQL commands to navigate the records without having the advantage of having a recordset object.

Remember, what you're dealing with when you run direct SQL is clear text records coming back to your machine from the server. There is no "object" that you can manipulate. That explains why you can't assign it to a recordset object. I guess if you wanted to you could create your own recordset-type class and read all the records into it from the server -- and you'd pretty much be duplicating the functionality that DAO, RDO, and ADO provide.

Working with direct SQL is nice in some cases, since you're foregoing all the overhead involved with class-based recordset access, but it's really kind of a pain in the butt because of all the extra coding involved.
0
 
LVL 1

Accepted Solution

by:
wizard2072098 earned 0 total points
ID: 1466519
See my comment, please.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

623 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