Solved

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

Posted on 1998-07-23
2
137 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 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

15 Experts available now in Live!

Get 1:1 Help Now