Showing posts with label mssql. Show all posts
Showing posts with label mssql. Show all posts

Thursday, March 8, 2012

Could not find stored procedure CMRC_ShoppingCartAddItem.

I am not sure were to start on how to fix this. I am not having any problems connecting to the mssql 2000 server. My problem is Could not find stored procedure 'CMRC_ShoppingCartAddItem'. The user has exec permissions on that procedure. This is a custom VB.net 2005 web application.. Does any one have any ideas on how to check whats wrong?

The sub that calls the procedure:
Public Sub AddItem(ByVal cartIDAs String,ByVal productIDAs String,ByVal CompanyAs String,ByVal quantityAs Integer)
' Create Instance of Connection and Command ObjectDim myConnectionAs SqlConnection =New SqlConnection("Data Source=MANDB02;Initial Catalog=db_name;UId=nobigaccess;Password=$$$$$$$")
Dim myCommandAs SqlCommand =New SqlCommand("CMRC_ShoppingCartAddItem", myConnection)
' Mark the Command as a SPROC myCommand.CommandType = CommandType.StoredProcedure' Add Parameters to SPROCDim parameterProductIDAs SqlParameter =New SqlParameter("@.ProductID", SqlDbType.NVarChar, 15)
parameterProductID.Value = productID
myCommand.Parameters.Add(parameterProductID)
Dim parameterCompanyAs SqlParameter =New SqlParameter("@.Company", SqlDbType.NVarChar, 8)
parameterCompany.Value = Company
myCommand.Parameters.Add(parameterCompany)
Dim parameterCartIDAs SqlParameter =New SqlParameter("@.CartID", SqlDbType.NVarChar, 50)
parameterCartID.Value = cartID
myCommand.Parameters.Add(parameterCartID)
Dim parameterQuantityAs SqlParameter =New SqlParameter("@.Quantity", SqlDbType.Int, 4)
parameterQuantity.Value = quantity
myCommand.Parameters.Add(parameterQuantity)
' Open the connection and execute the Command myConnection.Open() myCommand.ExecuteNonQuery() myConnection.Close()End Sub

This is what the procedure looks like in sql:

CREATE Procedure CMRC_ShoppingCartAddItem
(
@.CartIDnvarchar(50),
@.ProductIDnvarchar(23),
@.Companynvarchar(8),
@.Quantityint)As

DECLARE @.CountItemsint

SELECT @.CountItems =Count(ProductID)
FROM CMRC_ShoppingCartWHERE ProductID = @.ProductIDAND Company = @.Company
AND CartID = @.CartIDIF @.CountItems > 0/* There are items - update the current quantity */UPDATE CMRC_ShoppingCartSET Quantity = (@.Quantity + CMRC_ShoppingCart.Quantity)WHERE ProductID = @.ProductIDAND Company = @.Company
AND CartID = @.CartIDELSE/* New entry for this Cart. Add a new record */INSERT INTO CMRC_ShoppingCart
(
CartID,
Quantity,
ProductID,
Company
)
VALUES ( @.CartID, @.Quantity, @.ProductID, @.Company )GO

Try creating the proc with dbo as the owner.

CREATE Procedure dbo.CMRC_ShoppingCartAddItem

|||Changing it to dbo allowed the program to see it, just not access it. I changed the owner to the user id I am logging on with and that worked. Is that a bad idea? Should I try something else?|||

If you change the owner to the userid you login with, it may not be visible to other users. IDeally you create objects (tables/procs/views/functions etc) with dbo.<name>. You can then give the user access to the proc by giving EXEC permissions. you can also grant access as:

GRANT EXEC ON dbo.<yourproc> TO <yourUserLoginId>

Wednesday, March 7, 2012

Could not find stored procedure

I used ASP + mssql and got the following error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored
procedure 'my_db..po_fundprice_listVal'.
what is the error?
and how to solve it?
many many thanks.
If you are sure the stored procedure exists, I suggest you check the server
name and database context specified in the connection string to be certain
you are looking in the correct database.
Hope this helps.
Dan Guzman
SQL Server MVP
<Blue> wrote in message news:ekYzXX8jEHA.3632@.TK2MSFTNGP09.phx.gbl...
>I used ASP + mssql and got the following error:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored
> procedure 'my_db..po_fundprice_listVal'.
>
> what is the error?
> and how to solve it?
> many many thanks.
>
|||thanks for your reply.
since i am a newbie of sql server, how can I check whether the stored
procedure exists?
should I open the enterpise manager to check?
moreover, the db is newly given to us and we just import from the previous
vendor who exported all the data as a mdb file.
is it possible that they forgot to give us the stored procedure records?
thanks again. :-)
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
news:%23aufNl8jEHA.3852@.tk2msftngp13.phx.gbl g...
> If you are sure the stored procedure exists, I suggest you check the
server
> name and database context specified in the connection string to be certain
> you are looking in the correct database.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> <Blue> wrote in message news:ekYzXX8jEHA.3632@.TK2MSFTNGP09.phx.gbl...
>
|||You can use the object browser in SQL Server Enterprise Manager or Query
Analyzer to see if the procedure exists. Expand the desired database node
and then stored procedures.
I'm not sure exactly what you and the vendor did to export/import the SQL
Server database but there are no stored procedures in and Access mdb.
Perhaps this is why the proc was omitted in the process ...
Hope this helps.
Dan Guzman
SQL Server MVP
<Blue> wrote in message news:etoMlr8jEHA.2764@.TK2MSFTNGP11.phx.gbl...
> thanks for your reply.
> since i am a newbie of sql server, how can I check whether the stored
> procedure exists?
> should I open the enterpise manager to check?
> moreover, the db is newly given to us and we just import from the previous
> vendor who exported all the data as a mdb file.
> is it possible that they forgot to give us the stored procedure records?
> thanks again. :-)
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
> news:%23aufNl8jEHA.3852@.tk2msftngp13.phx.gbl g...
> server
>
|||ic... thanks
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
news:%23nKyaS9jEHA.592@.TK2MSFTNGP11.phx.gbl g...[vbcol=seagreen]
> You can use the object browser in SQL Server Enterprise Manager or Query
> Analyzer to see if the procedure exists. Expand the desired database node
> and then stored procedures.
> I'm not sure exactly what you and the vendor did to export/import the SQL
> Server database but there are no stored procedures in and Access mdb.
> Perhaps this is why the proc was omitted in the process ...
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> <Blue> wrote in message news:etoMlr8jEHA.2764@.TK2MSFTNGP11.phx.gbl...
previous
>

Could not find stored procedure

I used ASP + mssql and got the following error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored
procedure 'my_db..po_fundprice_listVal'.
what is the error?
and how to solve it?
many many thanks.If you are sure the stored procedure exists, I suggest you check the server
name and database context specified in the connection string to be certain
you are looking in the correct database.
--
Hope this helps.
Dan Guzman
SQL Server MVP
<Blue> wrote in message news:ekYzXX8jEHA.3632@.TK2MSFTNGP09.phx.gbl...
>I used ASP + mssql and got the following error:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored
> procedure 'my_db..po_fundprice_listVal'.
>
> what is the error?
> and how to solve it?
> many many thanks.
>|||thanks for your reply.
since i am a newbie of sql server, how can I check whether the stored
procedure exists?
should I open the enterpise manager to check?
moreover, the db is newly given to us and we just import from the previous
vendor who exported all the data as a mdb file.
is it possible that they forgot to give us the stored procedure records?
thanks again. :-)
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> ¦b¶l¥ó
news:%23aufNl8jEHA.3852@.tk2msftngp13.phx.gbl ¤¤¼¶¼g...
> If you are sure the stored procedure exists, I suggest you check the
server
> name and database context specified in the connection string to be certain
> you are looking in the correct database.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> <Blue> wrote in message news:ekYzXX8jEHA.3632@.TK2MSFTNGP09.phx.gbl...
> >I used ASP + mssql and got the following error:
> >
> > Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> > [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored
> > procedure 'my_db..po_fundprice_listVal'.
> >
> >
> > what is the error?
> > and how to solve it?
> > many many thanks.
> >
> >
>|||You can use the object browser in SQL Server Enterprise Manager or Query
Analyzer to see if the procedure exists. Expand the desired database node
and then stored procedures.
I'm not sure exactly what you and the vendor did to export/import the SQL
Server database but there are no stored procedures in and Access mdb.
Perhaps this is why the proc was omitted in the process ...
--
Hope this helps.
Dan Guzman
SQL Server MVP
<Blue> wrote in message news:etoMlr8jEHA.2764@.TK2MSFTNGP11.phx.gbl...
> thanks for your reply.
> since i am a newbie of sql server, how can I check whether the stored
> procedure exists?
> should I open the enterpise manager to check?
> moreover, the db is newly given to us and we just import from the previous
> vendor who exported all the data as a mdb file.
> is it possible that they forgot to give us the stored procedure records?
> thanks again. :-)
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> ¦b¶l¥ó
> news:%23aufNl8jEHA.3852@.tk2msftngp13.phx.gbl ¤¤¼¶¼g...
>> If you are sure the stored procedure exists, I suggest you check the
> server
>> name and database context specified in the connection string to be
>> certain
>> you are looking in the correct database.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> <Blue> wrote in message news:ekYzXX8jEHA.3632@.TK2MSFTNGP09.phx.gbl...
>> >I used ASP + mssql and got the following error:
>> >
>> > Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
>> > [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored
>> > procedure 'my_db..po_fundprice_listVal'.
>> >
>> >
>> > what is the error?
>> > and how to solve it?
>> > many many thanks.
>> >
>> >
>>
>|||ic... thanks
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> ¦b¶l¥ó
news:%23nKyaS9jEHA.592@.TK2MSFTNGP11.phx.gbl ¤¤¼¶¼g...
> You can use the object browser in SQL Server Enterprise Manager or Query
> Analyzer to see if the procedure exists. Expand the desired database node
> and then stored procedures.
> I'm not sure exactly what you and the vendor did to export/import the SQL
> Server database but there are no stored procedures in and Access mdb.
> Perhaps this is why the proc was omitted in the process ...
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> <Blue> wrote in message news:etoMlr8jEHA.2764@.TK2MSFTNGP11.phx.gbl...
> > thanks for your reply.
> > since i am a newbie of sql server, how can I check whether the stored
> > procedure exists?
> > should I open the enterpise manager to check?
> >
> > moreover, the db is newly given to us and we just import from the
previous
> > vendor who exported all the data as a mdb file.
> > is it possible that they forgot to give us the stored procedure records?
> >
> > thanks again. :-)
> >
> > "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> ¦b¶l¥ó
> > news:%23aufNl8jEHA.3852@.tk2msftngp13.phx.gbl ¤¤¼¶¼g...
> >> If you are sure the stored procedure exists, I suggest you check the
> > server
> >> name and database context specified in the connection string to be
> >> certain
> >> you are looking in the correct database.
> >>
> >> --
> >> Hope this helps.
> >>
> >> Dan Guzman
> >> SQL Server MVP
> >>
> >> <Blue> wrote in message news:ekYzXX8jEHA.3632@.TK2MSFTNGP09.phx.gbl...
> >> >I used ASP + mssql and got the following error:
> >> >
> >> > Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> >> > [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored
> >> > procedure 'my_db..po_fundprice_listVal'.
> >> >
> >> >
> >> > what is the error?
> >> > and how to solve it?
> >> > many many thanks.
> >> >
> >> >
> >>
> >>
> >
> >
>

Could not find stored procedure

I used ASP + mssql and got the following error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find st
ored
procedure 'my_db..po_fundprice_listVal'.
what is the error?
and how to solve it?
many many thanks.If you are sure the stored procedure exists, I suggest you check the server
name and database context specified in the connection string to be certain
you are looking in the correct database.
Hope this helps.
Dan Guzman
SQL Server MVP
<Blue> wrote in message news:ekYzXX8jEHA.3632@.TK2MSFTNGP09.phx.gbl...
>I used ASP + mssql and got the following error:
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not find
stored
> procedure 'my_db..po_fundprice_listVal'.
>
> what is the error?
> and how to solve it?
> many many thanks.
>|||thanks for your reply.
since i am a newbie of sql server, how can I check whether the stored
procedure exists?
should I open the enterpise manager to check?
moreover, the db is newly given to us and we just import from the previous
vendor who exported all the data as a mdb file.
is it possible that they forgot to give us the stored procedure records?
thanks again. :-)
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
news:%23aufNl8jEHA.3852@.tk2msftngp13.phx.gbl g...
> If you are sure the stored procedure exists, I suggest you check the
server
> name and database context specified in the connection string to be certain
> you are looking in the correct database.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> <Blue> wrote in message news:ekYzXX8jEHA.3632@.TK2MSFTNGP09.phx.gbl...
>|||You can use the object browser in SQL Server Enterprise Manager or Query
Analyzer to see if the procedure exists. Expand the desired database node
and then stored procedures.
I'm not sure exactly what you and the vendor did to export/import the SQL
Server database but there are no stored procedures in and Access mdb.
Perhaps this is why the proc was omitted in the process ...
Hope this helps.
Dan Guzman
SQL Server MVP
<Blue> wrote in message news:etoMlr8jEHA.2764@.TK2MSFTNGP11.phx.gbl...
> thanks for your reply.
> since i am a newbie of sql server, how can I check whether the stored
> procedure exists?
> should I open the enterpise manager to check?
> moreover, the db is newly given to us and we just import from the previous
> vendor who exported all the data as a mdb file.
> is it possible that they forgot to give us the stored procedure records?
> thanks again. :-)
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
> news:%23aufNl8jEHA.3852@.tk2msftngp13.phx.gbl g...
> server
>|||ic... thanks
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> bl
news:%23nKyaS9jEHA.592@.TK2MSFTNGP11.phx.gbl g...
> You can use the object browser in SQL Server Enterprise Manager or Query
> Analyzer to see if the procedure exists. Expand the desired database node
> and then stored procedures.
> I'm not sure exactly what you and the vendor did to export/import the SQL
> Server database but there are no stored procedures in and Access mdb.
> Perhaps this is why the proc was omitted in the process ...
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> <Blue> wrote in message news:etoMlr8jEHA.2764@.TK2MSFTNGP11.phx.gbl...
previous[vbcol=seagreen]
>