Showing posts with label errors. Show all posts
Showing posts with label errors. Show all posts

Sunday, March 25, 2012

AdventureWorksDW for Analysis services

Any body has a link for downloading that DB ? (Other than codeplex.com please !)

The one i have downloaded from codeplex produce errors related to missing (Data1.cab) File.

Any links ?

I've been VERY frustrated with Codex as well.

The best solution I've found is to go back to the SQL Server installation disk and reinstall the samples. If you installed these earlier, there is a script that will rebuild and load the Adventure Works DW relational database. (You will need to modify the data file path in the script.) You will then need to assemble the OLAP database using the provided solution.

B.

Thursday, March 22, 2012

AdventureWorks database not seen by Management Studio Express CTP

When I install AdventureWorks.db for SQL Express, it runs without errors. The database files (data and logs) are in the SQL Express 2005 data directory. However, I can not see the database in Managment Studio Express CTP. I've tried repairing and uninstall/install again. Does not help.

I have SQL Express 2005 cleanly installed. I have the pubs and Northwinds databases cleanly installed. (I was able to execute the queries that came for installing these). I can see both pubs and Northwinds in Management Studio Express CTP.

Any suggestions?

You won′t be able to see them if you don′t have permissions to the database itself, did you connect to database with the same credentials as you connected as you executed the queries that you mentioned ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

Yes, I did connect with the same credentials.

Also, the AdventureWorks did not come with a query like the pubs and Northwind databases. It just comes as a self-installing file. So I didn't have to open it in Mgmt Studio and execute it. It just installs and says it was successful when done.

|||

You must attach the files to an instance of SQL Server Express.

Execute the following script to identify the directory where the master database file is located.

select physical_name from sys.database_files where name = 'master'

Then, execute a similar script to attach the files.

exec sp_attach_db @.dbname=N'AdventureWorks', @.filename1=N'c:\Programas\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\AdventureWorks_Data.mdf', @.filename2=N'c:\Programas\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\AdventureWorks_log.ldf'

Regards.

|||I did all above and still did not see it in the list.|||

hi,

you mean you executed the attach statement with no exception raised and you can't see the database in the list of registered databases even after a refresh of the list (rx click the database node, refresh)?

regards

|||

Hi there.

When you start SQL Management Studio Express, right click on Databases and click add in the Attach Databases window that opens. This will open the directory tree on your system and it will default to the Data directory where the AdventureWorks database is installed by default. You should see it in the window. Select it and click OK. It will then appear in the Attach Databases window so click OK again.

You may have to refresh the Object Explorer window, and then the database will show up in your list of databases. Hope that helps.

Graham.

AdventureWorks database not seen by Management Studio Express CTP

When I install AdventureWorks.db for SQL Express, it runs without errors. The database files (data and logs) are in the SQL Express 2005 data directory. However, I can not see the database in Managment Studio Express CTP. I've tried repairing and uninstall/install again. Does not help.

I have SQL Express 2005 cleanly installed. I have the pubs and Northwinds databases cleanly installed. (I was able to execute the queries that came for installing these). I can see both pubs and Northwinds in Management Studio Express CTP.

Any suggestions?

You won′t be able to see them if you don′t have permissions to the database itself, did you connect to database with the same credentials as you connected as you executed the queries that you mentioned ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

Yes, I did connect with the same credentials.

Also, the AdventureWorks did not come with a query like the pubs and Northwind databases. It just comes as a self-installing file. So I didn't have to open it in Mgmt Studio and execute it. It just installs and says it was successful when done.

|||

You must attach the files to an instance of SQL Server Express.

Execute the following script to identify the directory where the master database file is located.

select physical_name from sys.database_files where name = 'master'

Then, execute a similar script to attach the files.

exec sp_attach_db @.dbname=N'AdventureWorks', @.filename1=N'c:\Programas\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\AdventureWorks_Data.mdf', @.filename2=N'c:\Programas\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\AdventureWorks_log.ldf'

Regards.

|||I did all above and still did not see it in the list.|||

hi,

you mean you executed the attach statement with no exception raised and you can't see the database in the list of registered databases even after a refresh of the list (rx click the database node, refresh)?

regards

|||

Hi there.

When you start SQL Management Studio Express, right click on Databases and click add in the Attach Databases window that opens. This will open the directory tree on your system and it will default to the Data directory where the AdventureWorks database is installed by default. You should see it in the window. Select it and click OK. It will then appear in the Attach Databases window so click OK again.

You may have to refresh the Object Explorer window, and then the database will show up in your list of databases. Hope that helps.

Graham.

Tuesday, March 6, 2012

ADOMD

Hello:
I've installed ADOMD.NET and I've tried to connect Analysis Service with
ASP.NET (using VB.NET). I receive errors but I don't know how I must use
ADOMD.NET. Can somebody help me and show me how I begin?
Thanks.
Regards.
look at this:
http://www.sqlserveranalysisservices...tGridIntro.htm
"Gema Snchez" <gema.sanchez@.grupo-episteme.com> wrote in message
news:OaL%23V8qYFHA.980@.TK2MSFTNGP12.phx.gbl...
> Hello:
> I've installed ADOMD.NET and I've tried to connect Analysis Service with
> ASP.NET (using VB.NET). I receive errors but I don't know how I must use
> ADOMD.NET. Can somebody help me and show me how I begin?
> Thanks.
> Regards.
>

ADOMD

Hello:
I've installed ADOMD.NET and I've tried to connect Analysis Service with
ASP.NET (using VB.NET). I receive errors but I don't know how I must use
ADOMD.NET. Can somebody help me and show me how I begin?
Thanks.
Regards.look at this:
http://www.sqlserveranalysisservice...etGridIntro.htm
"Gema Snchez" <gema.sanchez@.grupo-episteme.com> wrote in message
news:OaL%23V8qYFHA.980@.TK2MSFTNGP12.phx.gbl...
> Hello:
> I've installed ADOMD.NET and I've tried to connect Analysis Service with
> ASP.NET (using VB.NET). I receive errors but I don't know how I must use
> ADOMD.NET. Can somebody help me and show me how I begin?
> Thanks.
> Regards.
>

Saturday, February 25, 2012

ADODB errors since SQL 2000 upgrade

I have a VB 6.0 project that uses ADODB. Friday, it worked fine; Monday it
started generating the following two errors, one right after the other in
the order in which I've listed them:
-2147217885: Cursor operation conflict
2147217887: Multiple-step OLE DB operation generated errors. Check each OLE
DB status value, if available. No work was done.
The only difference is that it is now running against SQL 2000 database in
SQL 7.0 compatibility mode (Friday it was running against a SQL 7.0
database)
Any hits?- what the MDAC level on the old config and on the new config ?
jobi
"Nathan W. Phelps" <NOSPAM.nphelps@.solarc.com> wrote in message
news:#9BRQR5hDHA.2516@.TK2MSFTNGP09.phx.gbl...
> I have a VB 6.0 project that uses ADODB. Friday, it worked fine; Monday
it
> started generating the following two errors, one right after the other in
> the order in which I've listed them:
> -2147217885: Cursor operation conflict
> 2147217887: Multiple-step OLE DB operation generated errors. Check each
OLE
> DB status value, if available. No work was done.
> The only difference is that it is now running against SQL 2000 database in
> SQL 7.0 compatibility mode (Friday it was running against a SQL 7.0
> database)
> Any hits?
>|||On the server, I'm assuming that installing SQL 2000 upgrades the MDAC
stack. However, the client which is experiencing this issue was not
touched.
"jobi" <jobi@.reply2.group> wrote in message
news:bldugt$njq$1@.reader08.wxs.nl...
> - what the MDAC level on the old config and on the new config ?
> jobi
> "Nathan W. Phelps" <NOSPAM.nphelps@.solarc.com> wrote in message
> news:#9BRQR5hDHA.2516@.TK2MSFTNGP09.phx.gbl...
> > I have a VB 6.0 project that uses ADODB. Friday, it worked fine; Monday
> it
> > started generating the following two errors, one right after the other
in
> > the order in which I've listed them:
> >
> > -2147217885: Cursor operation conflict
> >
> > 2147217887: Multiple-step OLE DB operation generated errors. Check each
> OLE
> > DB status value, if available. No work was done.
> >
> > The only difference is that it is now running against SQL 2000 database
in
> > SQL 7.0 compatibility mode (Friday it was running against a SQL 7.0
> > database)
> >
> > Any hits?
> >
> >
>

ADODB Connection Open: Intermittent Timeout Expired Errors

Hello all-
Connecting to a SQL Server 2005 Express w/Advanced Services database using
ADODB in vbscript. The database is on the local server and am using shared
memory. The server has dual processors and 3GB Ram, but SQL Server Express i
s
limited to 1 processor and 1 GB of ram.
Every once in a great while I receive timeout expired errors while trying to
connect to the database. When it works, it connects in less than a
millisecond. Therefore I believe that increasing the timeout period in the
connection string rather than using its default of 30 seconds is not going t
o
fix this problem.
Const CONNECTION_STRING = "Provider=sqloledb;Data Source=INGEN;Initial
Catalog=Ingen;Integrated Security=SSPI;"
Dim dbConnection : Set dbConnection = CreateObject("ADODB.Connection")
Call dbConnection.Open(CONNECTION_STRING)
Microsoft OLE DB Provider for SQL Server error '80040e31'
Timeout expired
Any suggestions?
Thank you in advance.Go ahead and try the longer timeout. There may be other things happening on
your system that occasionally cause a hesitation. One of the more common
issues is that SQL Express databases have the autoclose option set by
default. This means that when no users are logged into a database, SQL
Server shuts it down to safe resources. The first user to login after the
database shuts down waits for the database to start up before the login is
complete so that may be what is causing the timeout. Generally starting up
a database takes only a few seconds but if the system is busy doing other
things it may take a while for SQL Server to obtain the resources it needs.
You can check this by using ALTER DATABASE to turn off the autoclose option
on your main databases.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Brian Kudera" <BrianKudera@.discussions.microsoft.com> wrote in message
news:89E366F9-6946-4B45-86AD-CC7B9B0EB5BE@.microsoft.com...
> Hello all-
> Connecting to a SQL Server 2005 Express w/Advanced Services database using
> ADODB in vbscript. The database is on the local server and am using
> shared
> memory. The server has dual processors and 3GB Ram, but SQL Server Express
> is
> limited to 1 processor and 1 GB of ram.
> Every once in a great while I receive timeout expired errors while trying
> to
> connect to the database. When it works, it connects in less than a
> millisecond. Therefore I believe that increasing the timeout period in the
> connection string rather than using its default of 30 seconds is not going
> to
> fix this problem.
> Const CONNECTION_STRING = "Provider=sqloledb;Data Source=INGEN;Initial
> Catalog=Ingen;Integrated Security=SSPI;"
> Dim dbConnection : Set dbConnection = CreateObject("ADODB.Connection")
> Call dbConnection.Open(CONNECTION_STRING)
> Microsoft OLE DB Provider for SQL Server error '80040e31'
> Timeout expired
> Any suggestions?
> Thank you in advance.|||Thanks Roger for your response. We started getting this error after
upgrading from MSDE to the 2005 Express version. Is this auto-close
something new to 2005? I verified that I do have auto-close turned off for m
y
database properties.
What would you suggest increasing the timeout period to?|||Yes, also look in the SQL Server errorlog file to see if any errors are
logged when the timeout happens.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Brian Kudera" <BrianKudera@.discussions.microsoft.com> wrote in message
news:D29FD261-9A6C-4083-8D1E-22C1914DB2DC@.microsoft.com...
> Thanks Roger for your response. We started getting this error after
> upgrading from MSDE to the 2005 Express version. Is this auto-close
> something new to 2005? I verified that I do have auto-close turned off for
> my
> database properties.
> What would you suggest increasing the timeout period to?|||Where do I find the SQL Server errorlog file?
I am on SQL Server Express so it will not let me view the logs in the SSMSE
interface. If you are talking about the logs in the Event Viewer, there was
nothing logged.
Thanks
"Roger Wolter[MSFT]" wrote:

> Yes, also look in the SQL Server errorlog file to see if any errors are
> logged when the timeout happens.|||Where do I find the SQL Server errorlog?
I am on SQL Server Express and cannot view the transaction logs from within
SSMSE. If you are talking about the system logs in the Event Viewer, there
was nothing logged in here during the time frame of the connection error.
"Roger Wolter[MSFT]" wrote:

> Yes, also look in the SQL Server errorlog file to see if any errors are
> logged when the timeout happens.|||C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG
assuming you installed express first and to the default location.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Brian Kudera" <BrianKudera@.discussions.microsoft.com> wrote in message
news:17F23E00-0514-43F1-9822-88F61816AD2D@.microsoft.com...[vbcol=seagreen]
> Where do I find the SQL Server errorlog?
> I am on SQL Server Express and cannot view the transaction logs from
> within
> SSMSE. If you are talking about the system logs in the Event Viewer,
> there
> was nothing logged in here during the time frame of the connection error.
> "Roger Wolter[MSFT]" wrote:
>|||Roger-
Increasing the timeout in the connection string appears to have fixed the
problem! No errors since making the change, so I think that's a good sign.
Thanks for your help.
"Roger Wolter[MSFT]" wrote:

> C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG
> assuming you installed express first and to the default location.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Brian Kudera" <BrianKudera@.discussions.microsoft.com> wrote in message
> news:17F23E00-0514-43F1-9822-88F61816AD2D@.microsoft.com...
>
>

ADODB Connection Open: Intermittent Timeout Expired Errors

Hello all-
Connecting to a SQL Server 2005 Express w/Advanced Services database using
ADODB in vbscript. The database is on the local server and am using shared
memory. The server has dual processors and 3GB Ram, but SQL Server Express is
limited to 1 processor and 1 GB of ram.
Every once in a great while I receive timeout expired errors while trying to
connect to the database. When it works, it connects in less than a
millisecond. Therefore I believe that increasing the timeout period in the
connection string rather than using its default of 30 seconds is not going to
fix this problem.
Const CONNECTION_STRING = "Provider=sqloledb;Data Source=INGEN;Initial
Catalog=Ingen;Integrated Security=SSPI;"
Dim dbConnection : Set dbConnection = CreateObject("ADODB.Connection")
Call dbConnection.Open(CONNECTION_STRING)
Microsoft OLE DB Provider for SQL Server error '80040e31'
Timeout expired
Any suggestions?
Thank you in advance.
Go ahead and try the longer timeout. There may be other things happening on
your system that occasionally cause a hesitation. One of the more common
issues is that SQL Express databases have the autoclose option set by
default. This means that when no users are logged into a database, SQL
Server shuts it down to safe resources. The first user to login after the
database shuts down waits for the database to start up before the login is
complete so that may be what is causing the timeout. Generally starting up
a database takes only a few seconds but if the system is busy doing other
things it may take a while for SQL Server to obtain the resources it needs.
You can check this by using ALTER DATABASE to turn off the autoclose option
on your main databases.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Brian Kudera" <BrianKudera@.discussions.microsoft.com> wrote in message
news:89E366F9-6946-4B45-86AD-CC7B9B0EB5BE@.microsoft.com...
> Hello all-
> Connecting to a SQL Server 2005 Express w/Advanced Services database using
> ADODB in vbscript. The database is on the local server and am using
> shared
> memory. The server has dual processors and 3GB Ram, but SQL Server Express
> is
> limited to 1 processor and 1 GB of ram.
> Every once in a great while I receive timeout expired errors while trying
> to
> connect to the database. When it works, it connects in less than a
> millisecond. Therefore I believe that increasing the timeout period in the
> connection string rather than using its default of 30 seconds is not going
> to
> fix this problem.
> Const CONNECTION_STRING = "Provider=sqloledb;Data Source=INGEN;Initial
> Catalog=Ingen;Integrated Security=SSPI;"
> Dim dbConnection : Set dbConnection = CreateObject("ADODB.Connection")
> Call dbConnection.Open(CONNECTION_STRING)
> Microsoft OLE DB Provider for SQL Server error '80040e31'
> Timeout expired
> Any suggestions?
> Thank you in advance.
|||Thanks Roger for your response. We started getting this error after
upgrading from MSDE to the 2005 Express version. Is this auto-close
something new to 2005? I verified that I do have auto-close turned off for my
database properties.
What would you suggest increasing the timeout period to?
|||Yes, also look in the SQL Server errorlog file to see if any errors are
logged when the timeout happens.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Brian Kudera" <BrianKudera@.discussions.microsoft.com> wrote in message
news:D29FD261-9A6C-4083-8D1E-22C1914DB2DC@.microsoft.com...
> Thanks Roger for your response. We started getting this error after
> upgrading from MSDE to the 2005 Express version. Is this auto-close
> something new to 2005? I verified that I do have auto-close turned off for
> my
> database properties.
> What would you suggest increasing the timeout period to?
|||Where do I find the SQL Server errorlog file?
I am on SQL Server Express so it will not let me view the logs in the SSMSE
interface. If you are talking about the logs in the Event Viewer, there was
nothing logged.
Thanks
"Roger Wolter[MSFT]" wrote:

> Yes, also look in the SQL Server errorlog file to see if any errors are
> logged when the timeout happens.
|||Where do I find the SQL Server errorlog?
I am on SQL Server Express and cannot view the transaction logs from within
SSMSE. If you are talking about the system logs in the Event Viewer, there
was nothing logged in here during the time frame of the connection error.
"Roger Wolter[MSFT]" wrote:

> Yes, also look in the SQL Server errorlog file to see if any errors are
> logged when the timeout happens.
|||C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG
assuming you installed express first and to the default location.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Brian Kudera" <BrianKudera@.discussions.microsoft.com> wrote in message
news:17F23E00-0514-43F1-9822-88F61816AD2D@.microsoft.com...[vbcol=seagreen]
> Where do I find the SQL Server errorlog?
> I am on SQL Server Express and cannot view the transaction logs from
> within
> SSMSE. If you are talking about the system logs in the Event Viewer,
> there
> was nothing logged in here during the time frame of the connection error.
> "Roger Wolter[MSFT]" wrote:
|||Roger-
Increasing the timeout in the connection string appears to have fixed the
problem! No errors since making the change, so I think that's a good sign.
Thanks for your help.
"Roger Wolter[MSFT]" wrote:

> C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG
> assuming you installed express first and to the default location.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Brian Kudera" <BrianKudera@.discussions.microsoft.com> wrote in message
> news:17F23E00-0514-43F1-9822-88F61816AD2D@.microsoft.com...
>
>

Thursday, February 16, 2012

ADO Errors collection question.

(SQL Server 2000, SP3a)
Hello all!
I'm using ADO to reference a SQL Server 2000 database and was curious about the ADO
Connection Errors collection. It's my understanding that this object will contain both
errors *and* messages (like those produced by the Transact-SQL "print" statement). Is
there any way to differentiate between an error and a message from the ADO Error object?
Thanks for any help you can provide!
John PetersonHi John,
Try to add SET NOCOUNT ON as a very first statement inside of your SP. It
will remove all the messages from the result
--
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
http://www.microsoft.com/security/incident/blast.asp
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:OQgk5hNwDHA.2076@.TK2MSFTNGP09.phx.gbl...
> (SQL Server 2000, SP3a)
> Hello all!
> I'm using ADO to reference a SQL Server 2000 database and was curious
about the ADO
> Connection Errors collection. It's my understanding that this object will
contain both
> errors *and* messages (like those produced by the Transact-SQL "print"
statement). Is
> there any way to differentiate between an error and a message from the ADO
Error object?
> Thanks for any help you can provide!
> John Peterson
>|||Thanks Val! I was looking for some way to determine whether the Error item was a bonafide
error, or just an informational message. I think I can make that determination by the
NativeError property. For messages, it seems to be 0 (sort of analogous to @.@.ERROR = 0).
"Val Mazur" <group51a@.hotmail.com> wrote in message
news:u1ZTJZSwDHA.2308@.TK2MSFTNGP11.phx.gbl...
> Hi John,
> Try to add SET NOCOUNT ON as a very first statement inside of your SP. It
> will remove all the messages from the result
> --
> Val Mazur
> Microsoft MVP
> Check Virus Alert, stay updated
> http://www.microsoft.com/security/incident/blast.asp
>
> "John Peterson" <j0hnp@.comcast.net> wrote in message
> news:OQgk5hNwDHA.2076@.TK2MSFTNGP09.phx.gbl...
> > (SQL Server 2000, SP3a)
> >
> > Hello all!
> >
> > I'm using ADO to reference a SQL Server 2000 database and was curious
> about the ADO
> > Connection Errors collection. It's my understanding that this object will
> contain both
> > errors *and* messages (like those produced by the Transact-SQL "print"
> statement). Is
> > there any way to differentiate between an error and a message from the ADO
> Error object?
> >
> > Thanks for any help you can provide!
> >
> > John Peterson
> >
> >
>|||Hi John!
I think that what constitutes an error vs message is pretty much up to each
individual's interpretation. QA, for instance only show text (and not the
red error stuff) for "messages" with severity level > 10. Perhaps ADO has
the same distinction regarding whether an exception is produced in the
application? (Should be easy to test.)
I would use the severity level if I would need to make such distinction
myself. A quick test with RAISERROR suggests that @.@.ERROR is indeed 0 for
severity level < 11, however.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:uULJ99SwDHA.2712@.TK2MSFTNGP11.phx.gbl...
> Thanks Val! I was looking for some way to determine whether the Error
item was a bonafide
> error, or just an informational message. I think I can make that
determination by the
> NativeError property. For messages, it seems to be 0 (sort of analogous
to @.@.ERROR = 0).
>
> "Val Mazur" <group51a@.hotmail.com> wrote in message
> news:u1ZTJZSwDHA.2308@.TK2MSFTNGP11.phx.gbl...
> > Hi John,
> >
> > Try to add SET NOCOUNT ON as a very first statement inside of your SP.
It
> > will remove all the messages from the result
> >
> > --
> > Val Mazur
> > Microsoft MVP
> > Check Virus Alert, stay updated
> > http://www.microsoft.com/security/incident/blast.asp
> >
> >
> > "John Peterson" <j0hnp@.comcast.net> wrote in message
> > news:OQgk5hNwDHA.2076@.TK2MSFTNGP09.phx.gbl...
> > > (SQL Server 2000, SP3a)
> > >
> > > Hello all!
> > >
> > > I'm using ADO to reference a SQL Server 2000 database and was curious
> > about the ADO
> > > Connection Errors collection. It's my understanding that this object
will
> > contain both
> > > errors *and* messages (like those produced by the Transact-SQL "print"
> > statement). Is
> > > there any way to differentiate between an error and a message from the
ADO
> > Error object?
> > >
> > > Thanks for any help you can provide!
> > >
> > > John Peterson
> > >
> > >
> >
> >
>

ADO errors after changing SP to use local variable

Changed stored procedure

[dbo].[spLogonName @.pNewLogonName varchar(60) AS

SELECT * FROM .dbo.tblUser Where vcLogonName = @.pNewLogonName

to

[dbo].[spLogonName @.pNewLogonName varchar(60) AS

DECLARE @.Local_pNewLogonName varchar(60)

SET @.Local_pNewLogonName = @.pNewLogonName

SELECT * FROM .dbo.tblUser Where vcLogonName = @.Local_pNewLogonName

and started getting this error on the web page.

ADODB.Recordset error '800a0cb3'

Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.

Does anyone know why this is happening? Nothing on the site has changed. If I change the sp back the errors go away. I'm trying to use local variables in all SP to avoid the slowness that can happen when using the parameter varibles.

Hi,

I guess you've changed the stored proc to avoid parameter sniffing and make sure the execution plan is stable? :-)

Could you try adding SET NOCOUNT ON to the beginning of the procedure? I suspect you're getting an additional DONE token from the SET statement and multiple recordsets. You could probably test that by calling NextRecordset method of the recordset.

HTH,
Jivko Dobrev - MSFT
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hello and thanks for the response.

Yes, I'm trying to change the sp to avoid sniffing.

I added SET NOCOUNT ON to the beginning of the procedure but it did not help. I removed the local variable stuff and left the NOCOUNT statement in and it doesn't like it either. It seems like it doesn't like any statements in the sp except the SELECT.

Here is more information if it helps.

Set query = Session_LogonNameQuery(NewLogonName)
Set oRecordSet = New ADODB.Recordset
Set oRecordSet = RetrieveDataRS(myconn, query, adOpenForwardOnly, adLockOptimistic, 1)

Even though I have adLockOptimistic selected the recordset has adLockReadOnly set.

Any help would be appreciated.

ADO does not add to Errors collection after the second FETCH NEXT in a SP

I'm having trouble obtaining errors raised in a stored
procedure via the ADO Errors collection after the second
FETCH NEXT statement from within that stored procedure.

Consider the following table created in a SQL Server
database:

CREATE TABLE TestTable
(
TestInt int
)
go

INSERT TestTable(TestInt) values(1)
INSERT TestTable(TestInt) values(2)
INSERT TestTable(TestInt) values(3)

This is a very simple table with one column, and three
rows containing the values 1, 2 and 3.

Consider this stored procedure:
CREATE PROCEDURE TestStoredProc
as
BEGIN
set rowcount 0
Set NoCount ON

declare @.TestInt int
declare @.ErrMsg char(7)
declare TestCursor cursor forward_only for
select * from TestTable

open TestCursor
Fetch next from TestCursor into @.TestInt

While @.@.fetch_status<>-1
Begin
select @.ErrMsg = 'Error ' + convert(char, @.testint)
raiserror(@.ErrMsg, 16, 1)
raiserror(@.ErrMsg, 16, 1)
Fetch next from TestCursor into @.TestInt
end

Close TestCursor
DeAllocate TestCursor
return
END

This stored procedure simply defines a cursor on all rows
in TestTable. For each row fetched from the cursor, the
error message 'Error n' is raised twice, where n is the
integer that had just been fetched from the cursor.

Finally, consider this VB code using ADO to execute the
above stored procedure. After the stored procedure is
executed, the code loops through the errors collection,
and creates a message box for each error in the collection:

Private Sub Form_Load()
Dim cn As Connection
Dim cm As Command
Dim oErr As Error

On Error Resume Next

Set cn = CreateObject("ADODB.Connection")
cn.Open "Data Source=<Some SQL Server>; Initial
Catalog=<Some Database Name>; Provider=SQLOLEDB; Persist
Security Info=False; Integrated Security=SSPI"

Set cm = CreateObject("ADODB.Command")
Set cm.ActiveConnection = cn
cm.CommandType = adCmdStoredProc
cm.CommandText = "TestStoredProc"
cm.Execute

For Each oErr In cn.Errors
MsgBox oErr.Description
Next

End
End Sub

When this code is executed, only two message boxes appear
with the message "Error 1".

Any help on this matter would be greatly appreciated :)Does anybody has any suggestions?|||Hi Ivan

You can bet your bottom dollar the focus of any replies will be on the use of the cursor rather than the ADO errors collection.

I know this is just an example - is this curiosity about a quirk you have spotted or a serious problem for you? If the latter, would you mind briefly explaining what your production cursor does as there are limited instances where it is as efficient as a set based solution. It may be that your sproc can be made more effective and your ADO errors issue made irrelevent.|||Of course, it is a serious problem for me. SP where this mechanism is used is a part of the big accounting system. Thus I can’t change it logic.

Thursday, February 9, 2012

Admin role lost - inability to administer database

When I open SQL Server Enterprise Administrator to create or manipulate data
bases errors are thrown at me for not having appropriate permissions. Howeve
r, on one database I am able to modify its contents, tables and so forth.
How have I lost access? What can I do to fix it?Hi,
Are you trying to do this with a user with "DB_OWNER" role. In this case
only the database which is assigned this role will only have the permission.
If you have to perform administrative task on all databases then either
register using "SA" user or a Login with "Sys Admin" server fixed role.
How to identify the role assigned:
1. Login to Query Analyser as "SA"
2. Execute the procedure sp_helplogins <login name>
Note:
Automatically the permissions will never be lost / revoked in SQL server.
Thanks
Hari
MCDBA
"John Russell" <anonymous@.discussions.microsoft.com> wrote in message
news:46C5D23D-730B-4820-97B6-F6A710E73C81@.microsoft.com...
> When I open SQL Server Enterprise Administrator to create or manipulate
databases errors are thrown at me for not having appropriate permissions.
However, on one database I am able to modify its contents, tables and so
forth.
> How have I lost access? What can I do to fix it?