473,785 Members | 2,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 GetNewOrderNumb er, is:

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

The other, called GetNewHoldingNu mber, is:

SELECT IIF ((SELECT COUNT(*) FROM Holdings), Max(Holding_num ber) + 1, 1) AS
NewHoldingNumbe r
FROM Holdings;

When I look at the database using the VB .Net's Server Explorer, I see that
GetNewHoldingNu mber is listed under the Views and GetNewOrderNumb er 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 1294
"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******** ******@TK2MSFTN GP11.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 GetNewOrderNumb er, is:

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

The other, called GetNewHoldingNu mber, is:

SELECT IIF ((SELECT COUNT(*) FROM Holdings), Max(Holding_num ber) + 1, 1) AS
NewHoldingNumbe r
FROM Holdings;

When I look at the database using the VB .Net's Server Explorer, I see that
GetNewHoldingNu mber is listed under the Views and GetNewOrderNumb er 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 GetNewOrderNumb er, is:

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

The other, called GetNewHoldingNu mber, is:

SELECT IIF ((SELECT COUNT(*) FROM Holdings), Max(Holding_num ber) + 1, 1) AS NewHoldingNumbe r
FROM Holdings;

When I look at the database using the VB .Net's Server Explorer, I see that GetNewHoldingNu mber is listed under the Views and GetNewOrderNumb er 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.mi crosoft.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.publi c.dotnet.langua ges.vb
NNTP-Posting-Host: cle-194-052.ppp.nacs.ne t 207.166.194.52
Path: cpmsftngxa07.ph x.gbl!cpmsftngx a10.phx.gbl!TK2 MSFTNGXA05.phx. gbl!TK2MSFTNGP0 8.phx.gbl!TK2MS FTNGP11.phx.gbl
Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:180107
X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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 GetNewOrderNumb er, is:

SELECT IIF ((SELECT COUNT(*) FROM Orders), Max(Order_numbe r) + 1, 1) AS
NewOrderNumb er
FROM Orders;

The other, called GetNewHoldingNu mber, is:

SELECT IIF ((SELECT COUNT(*) FROM Holdings), Max(Holding_num ber) + 1, 1) AS
NewHoldingNumb er
FROM Holdings;

When I look at the database using the VB .Net's Server Explorer, I see that
GetNewHoldingN umber is listed under the Views and GetNewOrderNumb er 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
3030
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 open questions: How to display a resultset
2
6076
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 can't get it working. I have a query defined (view) and want the end user to put in a start date and end date to filter a report.
6
4406
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 field between them. The join field in both tables are indexed and I'm selecting 1 field from each table to lookup. The Access query is taking more than 60 second to retrieve 1 record and if I execute the same query within the Query Analyzer, it...
23
3428
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 and ODBC 3.525.1117.0, on Windows XP Pro 5.1.2600 SP2 Nu 2600. I failed executing an Oracle stored procedure from Access, and a trigger to store data to a temporary table was active from SQL*Plus, but
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8988
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
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 we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.