Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Database keeps showing as Suspect...

Author  Topic 

coolazeem
Starting Member

7 Posts

Posted - 2006-02-20 : 05:36:41
I am currrently working on a ASP.Net 2.0 project using Sql Server 2000 with SP4. Whenever I run any query the connected database keeps showing as 'Suspect' and I can't access it from Enterprise Manager/ Query Analyzer. But my ASP.NET pages work fine. I can access my records as well as update them through my ASP pages.
Please help me out....
Here is the code which I use in my ASP.Net page

******************************************************
Dim selectsql As String
selectsql = "select au_fname FROM Authors"
Dim con As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=""C:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf"";Integrated Security=True;Connect Timeout=30;User Instance=True")
Dim cmd As New SqlCommand(selectsql, con)
Dim ass As SqlDataReader

Try
con.Open()
ass = cmd.ExecuteReader
Do While ass.Read
Dim newitem As New ListItem()
newitem.Text = ass("au_fname")
'newitem.Value = ass("zip")
ddl.Items.Add(newitem)
Loop

ass.Close()

Catch ex As Exception
lblmsg.Text = "error has occured "
lblmsg.Text &= ex.Message

Finally
If (Not con Is Nothing) Then
con.Close()
End If
End Try
*********************************************

Kristen
Test

22859 Posts

Posted - 2006-02-20 : 06:43:33
If its SUSPECT in EM I can't figure how anything would connect to it ... is it possible that your ASP stuff if connecting to a different server/database??

Your connection string looks like SQL2005 ... and seems at odds with "using Sql Server 2000 with SP4"

Kristen
Go to Top of Page

activecrypt
Posting Yak Master

165 Posts

Posted - 2006-02-21 : 02:04:14
Hi,
may suggest you to refer
http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=11689

http://support.microsoft.com/default.aspx?scid=kb;en-us;180500

http://www.mssqlcity.com/FAQ/Trouble/SuspectDB.htm

http://www.devx.com/vb2themax/Tip/18624


Andy Davis
Sql Shield Team
--------------------------------------------
SQL Server Encryption Software
http://www.sql-shield.com
Go to Top of Page

coolazeem
Starting Member

7 Posts

Posted - 2006-02-21 : 03:28:14
Hi Kristen!

Now that you mentioned SQLExpress, I feel that could be the problem. Actually I am using Visual Studio 2005 with SqlExpress. Is there any issue when you connect to a SQL2000 database using a SqlExpress connection string???? But as I mentioned before my Asp.net pages work fine. They actually access the database as well as insert records successfully. Are there any conflicts when u run SQL 2000 & SQLExpress concurrently on one PC?

These screenshots should give you an idea:
http://www.fileh.com/coolazeem/1.jpg
http://www.fileh.com/coolazeem/2.jpg
http://www.fileh.com/coolazeem/3.jpg
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-02-21 : 05:17:18
Sorry, can't help you on that one, I don't know anything about SQL2005!
Go to Top of Page

coolazeem
Starting Member

7 Posts

Posted - 2006-02-21 : 07:23:28
Hey Kristen!

The thing is that I want to work with SQl 2000 only not 2005. But the thing is that my server name does not show up in 'add new connection'. So kindly sugest any solution. Also check out the screenshots:
http://www.fileh.com/coolazeem/change_datasource.jpg
http://www.fileh.com/coolazeem/addconnection.jpg

In add connection my server name does not show up although SQL server is running....
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-02-21 : 08:10:46
You could try having a look at

www.connectionstrings.com

Kristen
Go to Top of Page
   

- Advertisement -