By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,074 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

P.S. This was originally posted on the m.p.d.f.adonet newsgroup, but it
didn't get an answer, and I think this is more VB .Net than ADO.Net anyway.
Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
"Rob Richardson" <th*****@n2net.net> schrieb

P.S. This was originally posted on the m.p.d.f.adonet newsgroup, but
it didn't get an answer, and I think this is more VB .Net than
ADO.Net anyway.

m.p.vsnet.ide might be even better because the server explorer is part of
the VS.NET IDE.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

P: n/a

"Rob Richardson" <th*****@n2net.net> wrote in message news:er**************@TK2MSFTNGP11.phx.gbl...
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

P.S. This was originally posted on the m.p.d.f.adonet newsgroup, but it
didn't get an answer, and I think this is more VB .Net than ADO.Net anyway.


Generally, an Access stored query is displayed as a view if it has no parameters, and as a stored procedure if it does. You
probably already know this, however. Is it possible that Holding_number is not a field in the database (i.e. the column name has
been renamed)? Otherwise, it seems that both should be listed as views.
--
Al Reid

"It ain't what you don't know that gets you into trouble. It's what you know
for sure that just ain't so." --- Mark Twain

Nov 20 '05 #3

P: n/a
Cor
Hi Rob,

I saw this also in the adonet group.

But this question is more for an access group I think.

Someone has put that procedure in the access database on 2 places, why he
did I think you have to ask the person who did it.

But maybe you get your answer here.

Another better newsgroup approach is to divide your question in two.

It are two questions and maybe there is someone who knows one, often than
you get no answer.

I hope this helps a very little bit?

Cor
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

P.S. This was originally posted on the m.p.d.f.adonet newsgroup, but it
didn't get an answer, and I think this is more VB .Net than ADO.Net anyway.

Nov 20 '05 #4

P: n/a
Thanks, Armin. I was not aware of that group. I will subscribe.

Rob
m.p.vsnet.ide might be even better because the server explorer is part of
the VS.NET IDE.

Nov 20 '05 #5

P: n/a
Al,

No, Holding_number is the correct name of the column in the table.

Rob
Nov 20 '05 #6

P: n/a
Cor,

I doubt very much that it is even possible to create two queries with the
same name. I checked the database to make sure, and it is not there. Also,
I am the one who created the database.

This question only has one part.

This question is about how VB.Net handles an Access database, not about the
Access database itself. Therefore, a VB.Net newsgroup is more appropriate.

Rob
Nov 20 '05 #7

P: n/a
Hi Rob,

I did a quick test by creating a couple tables, Orders and Holdings with columns that match your queries. I then duplicated your queries in access and open the database in VS. Net Server Explorer.
Both the Queries show up under Queries. So I have a couple questions that may help to narrow down what may be causing the issue.

What version of VS .Net are you using?
What version of the Jet OLEDB Provide are you using?
Does it matter if you create the database in Access 2000 verses coverting it from Access 97?

If you can provide some answers to these questions I can try to duplicate here.

Cameron Slade
Visual Studio Database Tools
ca***@online.microsoft.com
--------------------
From: "Rob Richardson" <th*****@n2net.net>
Subject: Why is one Access query a View and the other a Stored Procedure?
Date: Tue, 10 Feb 2004 08:04:26 -0500
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <er**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: cle-194-052.ppp.nacs.net 207.166.194.52
Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTN GXA05.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.ph x.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:180107
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

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

P.S. This was originally posted on the m.p.d.f.adonet newsgroup, but it
didn't get an answer, and I think this is more VB .Net than ADO.Net anyway.

Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.