473,320 Members | 2,054 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,320 software developers and data experts.

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

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
7 1280
"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

"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
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
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
Al,

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

Rob
Nov 20 '05 #6
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: totierne | last post by:
comp.databases.ms-access, I want to know how to use Oracle views with session variables in Access. The parameterised views in access, are migrated to views with per session variables. The...
2
by: Andy | last post by:
Hi guys I having a problem creating a report in Access 2003 project talking to a SQL database through and ODBC connect. After hours of trying things from Access Help, MSDN and Google I still...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
23
by: Gloops | last post by:
Hello everybody, Is anyone able to give me some indications about how to develop an Access interface for an Oracle database ? I dispose of Access 2003 (11.6566.8107) SP2, Oracle 9i 9.2.0.1.0...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.