473,396 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.CreateObject("ADODB.Connection")
strCon = "Provider=Microsoft.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 3452
Thanks - but throws up an error:

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'Provider=Microsoft.J'
/catamaranco/listings/index.asp, line 8
for >>>
set cnn = Server.CreateObject("ADODB.Connection")
strCon = "Provider=Microsoft.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***@TRASHaspfaq.com> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl... set rs = strCon.execute("EXEC qry_Listings")

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

"jason" <ja***@catamaranco.com> wrote in message
news:OU**************@tk2msftngp13.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.CreateObject("ADODB.Connection")
strCon = "Provider=Microsoft.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("ADODB.Connection")
conn.open "Provider= ..."
set rs = conn.execute("EXEC 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.CreateObject("ADODB.Connection")
strCon = "Provider=Microsoft.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.createobject("adodb.recordset")
cnn.qry_Listings rs
Jul 19 '05 #4
Thanks.

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:uQ**************@TK2MSFTNGP09.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("ADODB.Connection")
conn.open "Provider= ..."
set rs = conn.execute("EXEC qry_Listings")
...

Jul 19 '05 #5

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

Similar topics

4
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: ...
2
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...
0
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...
7
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...
5
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,...
6
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...
11
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
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...
8
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...
0
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...

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.