Why is one Access query a View and the other a Stored Procedure?

  • Thread starter Thread starter Rob Richardson
  • Start date Start date
R

Rob Richardson

Greetings!

I am rewriting a VB6 application in VB .Net. The database (which was
converted from Access 97 into Access 2000) has two nearly identical queries.
One, called GetNewOrderNumber, is:

SELECT IIF ((SELECT COUNT(*) FROM Orders), Max(Order_number) + 1, 1) AS
NewOrderNumber
FROM Orders;

The other, called GetNewHoldingNumber, is:

SELECT IIF ((SELECT COUNT(*) FROM Holdings), Max(Holding_number) + 1, 1) AS
NewHoldingNumber
FROM Holdings;

When I look at the database using the VB .Net's Server Explorer, I see that
GetNewHoldingNumber is listed under the Views and GetNewOrderNumber is
listed under the Stored Procedures. Why is that? Is this going to affect
how I use these queries in my application at all?

Thanks very much!

Rob
 
That's an interesting question. Actually, both of those SELECT
statements are simply QueryDef objects, or queries, as far as
Access/Jet is concerned. There is no such thing as either a View or a
Stored Procedure. The server explorer would be a mess of a UI if it
showed the actual properties for every provider, so they stuck with
SQL Server objects as the metaphor. Why the server explorer chose to
organize one query as a view, and a very similar one as a stored
procedure is a mystery :-)

-- Mary
MCW Technologies
http://www.mcwtech.com
 
Hi,

Could it be a case of parameters. If you execute the both queries in the
ms-access enviroment, I guess only one query pops up with an inputbox and
the other one doesn't. The one that needs input is the stored procedure.
Views are select-queries without parameters.
Is this the case ???

Greetingz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top