Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 1998-07-23
2
Medium Priority
?
144 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

705 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