473,472 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Procedure/Query Confusion

I've created a procedure/query in an Access 2000 database using the
following code:
<%
strAppend = "ProcName"
strSQL = "Create Procedure [qry" & strAppend & "] AS Select * From Stories
ORDER BY StoryID DESC;"
cn.execute(strSQL)
%>

I know I have successfully created the procedure/query, because when I run
the code again, it gives me the following error:

Microsoft JET Database Engine (0x80040E14)
Object 'qryProcName' already exists.

I look in the Access database and can't find qryProcName as a query, macro
or any other object. How do I access it?

Morris

Jul 22 '05 #1
7 1203
You should see it in the query collection in Access.

Mind if I ask why you're creating "stored procedures" this way? Do you not
have access to the Access file?

Ray at work

"Morris" <us**@domain.com> wrote in message
news:38*************@individual.net...
I've created a procedure/query in an Access 2000 database using the
following code:
<%
strAppend = "ProcName"
strSQL = "Create Procedure [qry" & strAppend & "] AS Select * From Stories
ORDER BY StoryID DESC;"
cn.execute(strSQL)
%>

I know I have successfully created the procedure/query, because when I run
the code again, it gives me the following error:

Microsoft JET Database Engine (0x80040E14)
Object 'qryProcName' already exists.

I look in the Access database and can't find qryProcName as a query, macro
or any other object. How do I access it?

Morris

Jul 22 '05 #2
It doesn't appear in the Query tab in Access.

I have access to the mdb file, but users of our intranet do not. The reason
for needing to create queries is a long story. It's also quite difficult to
explain. It may not even be the ideal solution (Bob's posts on
parameterised queries have got me thinking...), but it's one that could
work.

I could try to explain off list. If you manage to a) read through the whole
scenario (which will be long!) and b) think it's acceptable to make it a
post, I'd post it to the group as a whole.

Morris

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:O6**************@tk2msftngp13.phx.gbl...
You should see it in the query collection in Access.

Mind if I ask why you're creating "stored procedures" this way? Do you
not
have access to the Access file?

Ray at work

"Morris" <us**@domain.com> wrote in message
news:38*************@individual.net...
I've created a procedure/query in an Access 2000 database using the
following code:
<%
strAppend = "ProcName"
strSQL = "Create Procedure [qry" & strAppend & "] AS Select * From
Stories
ORDER BY StoryID DESC;"
cn.execute(strSQL)
%>

I know I have successfully created the procedure/query, because when I
run
the code again, it gives me the following error:

Microsoft JET Database Engine (0x80040E14)
Object 'qryProcName' already exists.

I look in the Access database and can't find qryProcName as a query,
macro
or any other object. How do I access it?

Morris


Jul 22 '05 #3
Morris wrote:
It doesn't appear in the Query tab in Access.


It won't. This is a limitation of Access. Procedures created
programmatically are not displayed in the GUI.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #4
Really? I tried it and I see it. I used Access 2002 and this code:

dim cn
set cn = createobject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\somepath\file.mdb"
strAppend = "ProcName"
strSQL = "create Procedure [qry" & strAppend & "] AS Select * From Stories
ORDER BY StoryID;"
cn.execute strSQL,,129
cn.close
set cn = nothing

Ray at work
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OP**************@TK2MSFTNGP10.phx.gbl...
Morris wrote:
It doesn't appear in the Query tab in Access.


It won't. This is a limitation of Access. Procedures created
programmatically are not displayed in the GUI.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 22 '05 #5
In earlier versions, it would not show up. It appears they have corrected
this.

Or maybe I have it confused with using ADOX to create the procedure ... I
have no time to test this now.

Ray Costanzo [MVP] wrote:
Really? I tried it and I see it. I used Access 2002 and this code:

dim cn
set cn = createobject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\somepath\file.mdb" strAppend = "ProcName"
strSQL = "create Procedure [qry" & strAppend & "] AS Select * From
Stories ORDER BY StoryID;"
cn.execute strSQL,,129
cn.close
set cn = nothing

Ray at work
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OP**************@TK2MSFTNGP10.phx.gbl...
Morris wrote:
It doesn't appear in the Query tab in Access.


It won't. This is a limitation of Access. Procedures created
programmatically are not displayed in the GUI.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #6
I'm using Access 2000 :-( I might test it on 2003 at work though.

Morris

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...
In earlier versions, it would not show up. It appears they have corrected
this.

Or maybe I have it confused with using ADOX to create the procedure ... I
have no time to test this now.

Ray Costanzo [MVP] wrote:
Really? I tried it and I see it. I used Access 2002 and this code:

dim cn
set cn = createobject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\somepath\file.mdb" strAppend = "ProcName"
strSQL = "create Procedure [qry" & strAppend & "] AS Select * From
Stories ORDER BY StoryID;"
cn.execute strSQL,,129
cn.close
set cn = nothing

Ray at work
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OP**************@TK2MSFTNGP10.phx.gbl...
Morris wrote:
It doesn't appear in the Query tab in Access.

It won't. This is a limitation of Access. Procedures created
programmatically are not displayed in the GUI.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 22 '05 #7
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...
In earlier versions, it would not show up. It appears they have corrected
this.

Or maybe I have it confused with using ADOX to create the procedure ... I
have no time to test this now.


You're not confused. This was a known issue in Access2K, resolved in
Access2K2. Here's a previous thread:
http://groups-beta.google.com/group/...dcd119946d7e57

Jul 22 '05 #8

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

Similar topics

5
by: Warren Wright | last post by:
Hi group, I have a select statement that if run against a 1 million record database directly in query analyzer takes less than 1 second. However, if I execute the select statement in a stored...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
10
by: Thomas R. Hummel | last post by:
I have a stored procedure that suddenly started performing horribly. The query plan didn't look right to me, so I copy/pasted the code and ran it (it's a single SELECT statement). That ran pretty...
1
by: Raquel | last post by:
Have a question on the Stored procedure method code generated by DB2 development center for Java stored procedures. Suppose I have a requirement to return the resultset consisting of FIRSTNME,...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
1
by: RSH | last post by:
Im trying to create a stored procedure of the following code. I want to set it so that I have to send the first 4 variables (@DB, @BackUpFile,@TestDB,@RestoreFile). I am having trouble when i try...
5
by: Nesa | last post by:
I have a stored procedure that wraps a moderately complex query over 5, 6 related tables. The performance of the procedure is unacceptably slow as it takes on average 5-10 min to complete. To...
5
by: ric_deez | last post by:
Hi there, I would like to create a simple search form to allow users to search for a job number based on a number of parameters. I think I understand how to use parameteres associated with Stored...
4
by: aCe | last post by:
hi all, i need to convert these simple PHP code into stored procedure : <?php $result = mssql_query( "SELECT whid, whcode FROM warehouse" ); while( $wh = mssql_fetch_object( $result ) ) {...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.