473,604 Members | 2,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stored Proc - quickest recordset?

What is the simplest way to open up a stored query in Access - I'v got this
far but I need to open: qry_Listings
set cnn = Server.CreateOb ject("ADODB.Con nection")
strCon = "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=" &
Server.MapPath( "../database/listings.mdb") '//This one is for Access
2000/2002
cnn.Open strCon
Jul 19 '05 #1
4 3474
Thanks - but throws up an error:

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'Provider=Micro soft.J'
/catamaranco/listings/index.asp, line 8
for >>>
set cnn = Server.CreateOb ject("ADODB.Con nection")
strCon = "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=" &
Server.MapPath( "../database/listings.mdb") '//This one is for Access
2000/2002
set rs = strCon.execute( "EXEC qry_Listings")

"Aaron Bertrand - MVP" <aa***@TRASHasp faq.com> wrote in message
news:OR******** ******@TK2MSFTN GP12.phx.gbl... set rs = strCon.execute( "EXEC qry_Listings")

http://www.aspfaq.com/2424#db

"jason" <ja***@catamara nco.com> wrote in message
news:OU******** ******@tk2msftn gp13.phx.gbl...
What is the simplest way to open up a stored query in Access - I'v got

this
far but I need to open: qry_Listings
set cnn = Server.CreateOb ject("ADODB.Con nection")
strCon = "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=" &
Server.MapPath( "../database/listings.mdb") '//This one is for Access
2000/2002
cnn.Open strCon


Jul 19 '05 #2
> set rs = strCon.execute( "EXEC qry_Listings")

Sorry, should be cnn.execute (and it should come *AFTER* cnn.Open strConn).

To avoid confusion, you might use a standard name for the object, and not
bother putting the string into a variable (you don't gain much from that
anyway, since it's only used once).

set conn = createobject("A DODB.Connection ")
conn.open "Provider= ..."
set rs = conn.execute("E XEC qry_Listings")
....
Jul 19 '05 #3
jason wrote:
What is the simplest way to open up a stored query in Access - I'v
got this far but I need to open: qry_Listings
set cnn = Server.CreateOb ject("ADODB.Con nection")
strCon = "Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=" &
Server.MapPath( "../database/listings.mdb") '//This one is for Access
2000/2002
cnn.Open strCon


This works as well:

set rs=server.creat eobject("adodb. recordset")
cnn.qry_Listing s rs
Jul 19 '05 #4
Thanks.

"Aaron Bertrand - MVP" <aa***@TRASHasp faq.com> wrote in message
news:uQ******** ******@TK2MSFTN GP09.phx.gbl...
set rs = strCon.execute( "EXEC qry_Listings")
Sorry, should be cnn.execute (and it should come *AFTER* cnn.Open

strConn).
To avoid confusion, you might use a standard name for the object, and not
bother putting the string into a variable (you don't gain much from that
anyway, since it's only used once).

set conn = createobject("A DODB.Connection ")
conn.open "Provider= ..."
set rs = conn.execute("E XEC qry_Listings")
...

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
13110
by: Jeremy | last post by:
Hi, I am having a problem running an sql stored procedure with ADO/ASP. If I hard code a select statement, the code works, but when I try to use a stored procedure it bombs. Here is my code: THIS WORKS: sql="SELECT PartNumber FROM Scrap WHERE DateOpened BETWEEN '20030601', '20030605'" 'Note: I already did my connection object above
2
3029
by: Stefan Berglund | last post by:
I'm having difficulty making a stored procedure with multiple input parameters work as a native method of the connection object. The only way I could get it to work was as below and I'm wondering if this falls into the category of dynamic SQL and thereby negates the value of the stored proc. I'm fairly certain that I've tried just about every permutation possible and unless I've failed with the magic search criteria Google is far from...
0
2288
by: udo polder | last post by:
hello all i am having some problems calling a stored procedure on MSSQL2000 from VC7. i have build up an OLEDB-Consumer (for stored Procs) via vizzard and modifyed it a little, to bring in the cloumn and param map. when i start the program i can call OpenAll() and the system gets the recordset from the DB. but data is corrupted :( also the recordcount DOSE match the recordcount from the stored proc (if i add a entry to the table i get one...
7
10231
by: Alex Vorobiev | last post by:
hi there, i am using sql server 7. below is the stored procedure that is giving me grief. its purpose it two-fold, depending on how it is called: either to return a pageset (based on page number and page size), or to return IDs of previous and next records (based on current record id). the problem is, that the order in which records are inserted into the temp table is inconsistent, even though the calling statement and the order by is...
5
2600
by: rhungund | last post by:
Hi All. My question is this. I have a complex stored procedure in SQL Server which works fine when I run it in Query Analyzer. However, when I call it within my ASP script, it returns nothing, and sometimes locks up. If I change my script to call other existing stored procedures it works fine. It's just with this particular stored proc. I have tried various DB calls in ASP, such as opening the recordset through an ADO connection and...
6
1609
by: CJM | last post by:
I've created a Stored Procedure which adds a new record and updates some more records and then returns the primary key for the added record. The SP seems to work OK, but I'm having problems getting at the returned key in my ASP code: "Item cannot be found in the collection corresponding to the requested name or ordinal." A common error, but in this case I can't see why... I output the SQL
11
3479
by: ColdCanuck | last post by:
Greetings! I am VERY new to DB2 but not Orable, Sybase and SQL Server. I am trying to call a stored procedure via VB 6 and ADO/OLEDB. But when I try to execute
1
1603
by: Eric E | last post by:
Hi all, I am using an Access 2000 client linked to a Postgresql 7.4 server via ODBC. I have a stored proc on the server that inserts rows into a table.particular table, accomplished via an INSERT within the body of the stored proc. The problem is that Access will not modify these records via table or form view (form has a DAO recordset), giving its generic "Write
8
11250
by: colmkav | last post by:
Can someone tell me how I can access the return value of a function called from Oracle as opposed to a store proc from oracle? my oracle function is get_num_dates_varposfile. I am only used to using this method with store procs that dont return a value back to Access. Hope this makes sense. Set Cmd = New Command With Cmd Set .ActiveConnection = get_XE_Conn 'makes a connection Oracle XE
0
7997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8409
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8065
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8280
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6739
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5882
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3955
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1266
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.