Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Sunday, March 11, 2012

Error/Failure Audit in Event Logs (SQL 2005 Express) [Advanced Services]

Q1: Any way to control which db loads when, and perhaps stop this error from happening? Again- when all is said and done, the report server functions, and I am able to access just fine.

Q2: What kind of recovery is being referred to? Given the message type- I assume it's nothing of concern- probably more to do with a system that doesn't run all the time.

Okay- so I get these two event messages each time I boot.

Below are two error message I see daily with each system boot- the services mentioned do "actually" function, and are running- as not 10 seconds after these messages are logged, the successfully loaded messages appear. It's almost as if report services tries to connect before the databases are up and running.

Basically the sequence (today) was:

1. 05:49:01 Failure Audit (MSSQL$SQLEXPRESS)

2. 05:49:01 Error (Report Server Windows Service (SQLEXPRESS)

3. 05:49:02 Recovery is complete. (EventID 3408 MSSQL$SQLEXPRESS)

4. 05:49:06 Starting up database 'ReportServer'

5. 05:49:09 Server Resumed execution (MSSQL$SQLEXPRESS)

I'm assuming based on the events that Report Server Service attempts to connect to the ReportServer database before it's actually started. Doesn't really explain the failure audit-

1. Failure Audit:

Event Type: Failure Audit
Event Source: MSSQL$SQLEXPRESS
Event Category: (4)
Event ID: 18456
Date: 8/9/2007
Time: 05:49:01
User: <MACHINENAME>\<LOCALUSER>
Computer: <MACHINENAME>
Description:
Login failed for user '<MACHINENAME>\<LOCALUSER>'.

[CLIENT: <local machine>]

This is almost immediately followed by this (which I consider a no-brainer, considering the above):

2. Error:

Event Type: Error
Event Source: Report Server Windows Service (SQLEXPRESS)
Event Category: Management
Event ID: 107
Date: 8/9/2007
Time: 05:49:01
User: N/A
Computer: <MACHINENAME>
Description:
Report Server Windows Service (SQLEXPRESS) cannot connect to the report server database.

The master database is started first, you cannot control the order in which the database are started up. if the users tries to connect to the database he will be authenticated by SQL Server and directly tries to change the default database or if explicitly mentioned in the connection string connect to the database. if the database is not yet started he will get a login failed (although authenticated but he was not able to change the database context). if you have these problems, try to set the dependency of Report Server to the SQL Service to make sure that Reporting Server will only be started if the SQL Server Service has been. This might help you getting some additional time for the server to make a regular recovery (which is normal if the database / server was not shutdown properly)

Jens K. Suessmeyer

http://www.sqlserver2005.de

Friday, February 24, 2012

Error while using database procedure in a gridview control

Dear Forum,

I have a gridview control which is associated to a storedprocedure with a parameter(Customer Number) to be supplied. In theDefine Custom Statement or stored procedure section I selected stored procedure and selected the stored procedure. The Define Parameter window I defaulted the Parameter Source as 'none' and default value as '%'. In the next screen, I do a test query which retuns the following error

There was an error executing the query. Please check the syntax of the command and if present, the type and values of the parameters and ensure that they are correct.

[Error 42000] [Microsoft][ODBC SQL Server Drive][SQL Server] Procedure 'SP_TransactionDetails' expects parameter'@.cnum' which was not supplied.

I am using SQL server studio 2005 version2.0.

But the same procedure, if I use as SQL Statement, it works.

Can somebody help me.

Thanks,

Hidayath

Hi

'@.cnum' seems to be Int. Does "%' match the type?


When you click test query there should pop up a window then you could input other values to see what will happen.

|||Hi Hidayath, can you post the definition of the problematical stored procedure?|||

Hi,

The problem was related to the connection. I was using the DSN on my local machine pointed to an sql server in the network. I dropped the connection and re-created a new connection with the server name it works.

Thanks

Wednesday, February 15, 2012

Error while connect to SQL Server using ADO control

The following error happens in my ASP.NET page from time to time. It will disappear after I restart the SQL Server. I guess I messed up in the garbage collection, but I really don't know what to do except using "conn=nothing" statement, can anyone help me with this?

Thanks!

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Runtime.InteropServices.COMException: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

Source Error:

Line 39: Public Sub New()Line 40: conn = New ADODB.ConnectionLine 41: conn.Open("Provider=SQLOLEDB.1;Persist Security Info=xxxxx;User ID=xxxxx;Initial Catalog=xxxx;Data Source=xxx")Line 42: rs = New ADODB.RecordsetLine 43: my_UserID = 0

try encasing your db interaction in a using{} block - that way it will make sure that the dispose() method has been called and the objects marked for garbage collection.|||

DWesthead:

try encasing your db interaction in a using{} block - that way it will make sure that the dispose() method has been called and the objects marked for garbage collection.

I am not using C#, I am using VB, do you know the garbage collection using VB?

Thanks!

|||

In VB you can use something like this:

Using connectionAsNew SqlConnection()

connection.ConnectionString = connectionString

connection.Open()

Console.WriteLine("State: {0}", connection.State)
Console.WriteLine("ConnectionString: {0}", _
connection.ConnectionString)
End Using

|||

I tried to do that, but the "Using" tag is not recognized, maybe there is no such a thing as "USING" in VB?

|||

Using works for me:

Using connAsNew SqlConnectionEndUsing

Using turns blue, and when I finish the first line, it inserts the End using statement for me.

Curious, why are you using adodb instead of sqlconnect/sqlcommand?

|||

I am using adodb because I am used to it. I programed several ASP program using adodb.

I think I might not have to most recent asp.net sdk install then, I will try to install it now.

Could you tell me any different from sqlconnection and the adodb connection? how to use sqlconnection?

Thanks!

Alex

|||

They are very similiar. The easiest way to make a correct sqlconnection string is to drop a sqldatasource control on your page, then use the wizardBig Smile

I often do that even for connection strings that I use programmatically, I just tell the wizard to put it in web.config, and after the wizard is done, I'll delete the sqldatasource from the page, and access the connectionstring programmatically.