Solved

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

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

808 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