A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Creating a stored procedure (query) in access



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2004, 12:29 PM
Michel Walsh
external usenet poster
 
Posts: n/a
Default Creating a stored procedure (query) in access

Hi,


CurrentProject.Connection.Execute "DROP PROCEDURE toto"


will drop the procedure (not procedute, as in my first message, sorry for
the typo).



Hoping it may help,
Vanderghast, Access MVP



"Tor Inge Rislaa" wrote in message
...
This work just as I wanted. My next quetion is if there is a similar way

to
remove an existing query, in the purpose of replacing a query with a new
with the same name.

"Michel Walsh" vanderghast@VirusAreFunnierThanSpam skrev i melding
...
Hi,

Yes, but that will be almost the same functionality than for a query
with parameters (which is not standard in SQL, but the traditional way

to
do
it in Jet). You also have to use ADO, not DAO, not the query designer.

Here,
in the Immediate Debug Window, you can use:


CurrentProject.Connection.Execute "CREATE PROCEDUTE toto( arg LONG) AS
SELECT * FROM myTable WHERE myField=arg ;"


and, instead of using a command object, you can simply use, in your

code:


Set myRecordseet= CurrentProject.Connection.Execute("EXECUTE toto 22" )

and still beneficiate of an eventual advantage of a precompiled "query"

(the
procedure toto).




Hoping it may help,
Vanderghast, Access MVP




"Tor Inge Rislaa" wrote in message
...
Creating a stored procedure (query) in access

In SQL Server I would write something like the syntax below to create

a
stored procedure. Is there a similar way to create a query in access,

by
code?

CREATE PROCEDURE qryMyquery AS SELECT My_Id, MyDescription From

MyTable

TIRislaa








 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.