to get the database back, and it works well on the server, which means
i can get the data using Query analyser, but when i use the web
application to access the database, it always come out with error
message, it seems that the connection to the database can not be
established, but it used to be ok before i reinstalled the sql server.
do i need to do any configuration after attaching the data files and
log files(.mdf and .ldf).
i think the source code(i mean the database connection code) for the
web application should be fine caze i didnt change it before after.
caze i didnt create instance of database and just use default, so the
connection string is defined below:
thisConnection = new SqlConnection(@."Data Source=pdsmfg014;Initial
Catalog=epcsii;User ID=epcs2;Password=******")
the server name is pdsmfg014
the database name is epcsii
oh, the code is designed using C#Dee (luye_qq@.hotmail.com) writes:
> i reinstall the sql server on the machine, and use attach file method
> to get the database back, and it works well on the server, which means
> i can get the data using Query analyser, but when i use the web
> application to access the database, it always come out with error
> message, it seems that the connection to the database can not be
> established, but it used to be ok before i reinstalled the sql server.
> do i need to do any configuration after attaching the data files and
> log files(.mdf and .ldf).
> i think the source code(i mean the database connection code) for the
> web application should be fine caze i didnt change it before after.
> caze i didnt create instance of database and just use default, so the
> connection string is defined below:
> thisConnection = new SqlConnection(@."Data Source=pdsmfg014;Initial
> Catalog=epcsii;User ID=epcs2;Password=******")
> the server name is pdsmfg014
> the database name is epcsii
So is this login epcs2 present on the reinstalled server? In such
case it could be that when you reinstalled the server the mapping
between logins and database users were lost. Run sp_helpuser in the
database and see if the output makes sense.
If not the procedure sp_changes_users_login can help you. Please check
Books Online for details.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||thx, erland,
I think the databse is working properly right now.
it must be some OS environment problems that prevent the application
accessing the database.
caze i migrate the application to my laptop and also install the SQL
server on my laptop to access the database, it works. it just means,
the laptop is my application server ,and the original server is just
the database server.
thus, there is sth wrong with my IIS setting probably, but I dont know
how to fig it out.
anyone can help?|||Hi,
You did not mention what kind of error you are getting.
If you are getting access denied error then make sure your Sql instance
authentication is eiter mixed mode or in SQl server authentication mode
and check the user has proper permission on that server, the easiest
way to check is open query analyzer from your laptop and give the same
server name(type id down), userid and password.
besides this make sure both database server and your laptop are in the
same domain and also you can try switching off the windows xp fire
wall.
bye
ssk
Dee wrote:
> thx, erland,
> I think the databse is working properly right now.
> it must be some OS environment problems that prevent the application
> accessing the database.
> caze i migrate the application to my laptop and also install the SQL
> server on my laptop to access the database, it works. it just means,
> the laptop is my application server ,and the original server is just
> the database server.
> thus, there is sth wrong with my IIS setting probably, but I dont know
> how to fig it out.
> anyone can help?|||Dee (luye_qq@.hotmail.com) writes:
> I think the databse is working properly right now.
> it must be some OS environment problems that prevent the application
> accessing the database.
> caze i migrate the application to my laptop and also install the SQL
> server on my laptop to access the database, it works. it just means,
> the laptop is my application server ,and the original server is just
> the database server.
> thus, there is sth wrong with my IIS setting probably, but I dont know
> how to fig it out.
> anyone can help?
As a start, please post the exact error message you are getting.
Did you perform the check with sp_helpuser, that I suggested?
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp