Hi all,
I have this error "SQL server does not exist or access denied" whenever I try to access the database. I can access the database in my local machine,say: http:\\localhost\mysite.htm ... (This one is for testing, I need to public this website from other machine)
But now, I move the site to other machine and run these same queries again into the microsoft sql server 2000 of that machine:
QUERY:
IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'PLUS')
DROP DATABASE [PLUS]
GO
CREATE DATABASE [PLUS]
GO
Print 'Okay, database created'
use [PLUS]
GO
Print 'Okay, objects dropped'
Print 'Creating PLUSUserLogin'
/****** Object: Login PLUSUser Script Date: 8/29/2001 4:52:14 AM ******/
if not exists (select * from master.dbo.syslogins where loginname = N'PLUSUser')
BEGIN
declare @logindb nvarchar(132), @loginlang nvarchar(132) select @logindb = N'PLUS', @loginlang = N'us_english'
if @logindb is null or not exists (select * from master.dbo.sysdatabases where name = @logindb)
select @logindb = N'master'
if @loginlang is null or (not exists (select * from master.dbo.syslanguages where name = @loginlang) and @loginlang <> N'us_english')
select @loginlang = @@language
exec sp_addlogin N'PLUSUser', 'secret', @logindb, @loginlang
END
GO
/****** Object: User dbo Script Date: 8/29/2001 4:52:14 AM ******/
/****** Object: User PLUSUser Script Date: 8/29/2001 4:52:14 AM ******/
if not exists (select * from dbo.sysusers where name = N'PLUSUser' and uid < 16382)
EXEC sp_grantdbaccess N'PLUSUser', N'PLUSUser'
GO
/****** Object: User PLUSUser Script Date: 8/29/2001 4:52:14 AM ******/
exec sp_addrolemember N'db_owner', N'PLUSUser'
GO
Print 'Okay, login added'
Print 'Creating tables...'
CREATE TABLE UserList
(
u_id INT NOT NULL IDENTITY,
u_username VARCHAR( 100 ),
u_password VARCHAR( 100 )
)
but the when I tried the same connection string:
"Server=localhost;UID=PLUSUser;PWD=secret;Database=PLUS"
it came up the error "SQL server does not exist or access denied".
ps: There are 3 SQL server in this machine. localserver, server1, server2
Thanks
lehuong
I have this error "SQL server does not exist or access denied" whenever I try to access the database. I can access the database in my local machine,say: http:\\localhost\mysite.htm ... (This one is for testing, I need to public this website from other machine)
But now, I move the site to other machine and run these same queries again into the microsoft sql server 2000 of that machine:
QUERY:
IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'PLUS')
DROP DATABASE [PLUS]
GO
CREATE DATABASE [PLUS]
GO
Print 'Okay, database created'
use [PLUS]
GO
Print 'Okay, objects dropped'
Print 'Creating PLUSUserLogin'
/****** Object: Login PLUSUser Script Date: 8/29/2001 4:52:14 AM ******/
if not exists (select * from master.dbo.syslogins where loginname = N'PLUSUser')
BEGIN
declare @logindb nvarchar(132), @loginlang nvarchar(132) select @logindb = N'PLUS', @loginlang = N'us_english'
if @logindb is null or not exists (select * from master.dbo.sysdatabases where name = @logindb)
select @logindb = N'master'
if @loginlang is null or (not exists (select * from master.dbo.syslanguages where name = @loginlang) and @loginlang <> N'us_english')
select @loginlang = @@language
exec sp_addlogin N'PLUSUser', 'secret', @logindb, @loginlang
END
GO
/****** Object: User dbo Script Date: 8/29/2001 4:52:14 AM ******/
/****** Object: User PLUSUser Script Date: 8/29/2001 4:52:14 AM ******/
if not exists (select * from dbo.sysusers where name = N'PLUSUser' and uid < 16382)
EXEC sp_grantdbaccess N'PLUSUser', N'PLUSUser'
GO
/****** Object: User PLUSUser Script Date: 8/29/2001 4:52:14 AM ******/
exec sp_addrolemember N'db_owner', N'PLUSUser'
GO
Print 'Okay, login added'
Print 'Creating tables...'
CREATE TABLE UserList
(
u_id INT NOT NULL IDENTITY,
u_username VARCHAR( 100 ),
u_password VARCHAR( 100 )
)
but the when I tried the same connection string:
"Server=localhost;UID=PLUSUser;PWD=secret;Database=PLUS"
it came up the error "SQL server does not exist or access denied".
ps: There are 3 SQL server in this machine. localserver, server1, server2
Thanks
lehuong