Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Tuesday, March 27, 2012

Connecting to SQL Server 2000 on Windows 2003 Server using sql-dmo

Hi
I have a strange problem connecting to a local SQL Server 2000 on a machine
running Windows 2003 Server.
I'm using a plain connection as shown in the code below:
Dim oServer as New SQLDMO.SQLServer
With oServer
.LoginTimeout = -1
.LoginSecure = True 'Use NT Authentication
.AutoReConnect = False
.Connect (strServerName)
End With
I'm connecting through the IP of the machine.
The problem is:
When I have a system32\drivers\etc\hosts entry specified pointing at the
same machine, then I cannot connect to the SQL Server using NT Authenticatio
n.
I can however still connect by using SA user.
Error is:
Runtime error '-2147203052 (80044814)':
[Microsoft][ODBC SQL Server Driver][SQL Server] Login failed for user
'(null)'. Reason: Not associated with a trusted SQL Server connection.
If I remove the hosts entry I can connect without problems using both NT
authentication and SA user.
It doesn't make any difference about the problem if I'm running NT
authentication mode or mixed mode.
This code having this problem has run without problems on Windows 2000
server, so it is an issue with Windows 2003 server.
Does anyone have a clue to what might cause this problem?
Thanx in advance
/BrianJust a note, if other people should have the same problem.
A temporary work-around is to define the entry in the Hosts entry as an
Alias in
SQL Server - Client Network Utility.
/Brian
"Brian Nielsen" wrote:

> Hi
> I have a strange problem connecting to a local SQL Server 2000 on a machin
e
> running Windows 2003 Server.
> I'm using a plain connection as shown in the code below:
> Dim oServer as New SQLDMO.SQLServer
> With oServer
> .LoginTimeout = -1
> .LoginSecure = True 'Use NT Authentication
> .AutoReConnect = False
> .Connect (strServerName)
> End With
> I'm connecting through the IP of the machine.
> The problem is:
> When I have a system32\drivers\etc\hosts entry specified pointing at the
> same machine, then I cannot connect to the SQL Server using NT Authenticat
ion.
> I can however still connect by using SA user.
> Error is:
> Runtime error '-2147203052 (80044814)':
> [Microsoft][ODBC SQL Server Driver][SQL Server] Login failed for user
> '(null)'. Reason: Not associated with a trusted SQL Server connection.
> If I remove the hosts entry I can connect without problems using both NT
> authentication and SA user.
> It doesn't make any difference about the problem if I'm running NT
> authentication mode or mixed mode.
> This code having this problem has run without problems on Windows 2000
> server, so it is an issue with Windows 2003 server.
> Does anyone have a clue to what might cause this problem?
> Thanx in advance
> /Brian

connecting to SQL Server 2000 from a VB.net app using ADO.net

Hi
I can connect from my app to sql server on the local lan, but I can't connect over the
Internet. I can't create a remote connection in Enterprise Manager. However, I can
ping the IP address of the server just fine.
The app uses the following connect string:
Provider=SQLOLEDB;User
ID=******;Password=******;Server=******;Database=* *****;Network Address=******
Where 'Network Address' = the IP address of the machine where SQL Server is
installed.
This connect string works great from any machine connected to the same lan as the
SQL Server machine. However, whenever I try to connect across the Internet (from my
home machine, using the exact same software and connect string), I take the
following error:
Client unable to establish connection ConnectionOpen(CreateFile()
Question 1: Does anybody have any suggestions as to why I can connect over the LAN
but not over the Internet? I suspect some networking thing, like a firewall on the
lan where I am trying to connect, but I am not a networking expert.
Question 2: Does anyone have any opinion about whether this is a valid DBIO
technique? Most databases that are accessed over the Internet have thin-client
interfaces implemented in front of them. I have never tried to do this from a Windows
fat-client, and I suspect very poor performance and excess resource utilization on
the server
Any help or article will be appriciated
In terms of connectivity issues over the Internet, firewall
issues would be my first guess. You may want to take a look
at the following article:
INF: TCP Ports Needed for Communication to SQL Server
Through a Firewall
http://support.microsoft.com/?id=287932
In terms of the application issues, it depends on the app.
The resource problems on the database server are most often
due to coding issues, not really what type of client is
used. Either can perform well or perform poorly depending on
how they are coded.
-Sue
On Thu, 15 Apr 2004 09:56:07 -0700, "Lisa Jones"
<anonymous@.discussions.microsoft.com> wrote:

>Hi
>I can connect from my app to sql server on the local lan, but I can't connect over the
>Internet. I can't create a remote connection in Enterprise Manager. However, I can
>ping the IP address of the server just fine.
>The app uses the following connect string:
>Provider=SQLOLEDB;User
>ID=******;Password=******;Server=******;Database= ******;Network Address=******
>Where 'Network Address' = the IP address of the machine where SQL Server is
>installed.
>This connect string works great from any machine connected to the same lan as the
>SQL Server machine. However, whenever I try to connect across the Internet (from my
>home machine, using the exact same software and connect string), I take the
>following error:
>Client unable to establish connection ConnectionOpen(CreateFile()
>Question 1: Does anybody have any suggestions as to why I can connect over the LAN
>but not over the Internet? I suspect some networking thing, like a firewall on the
>lan where I am trying to connect, but I am not a networking expert.
>Question 2: Does anyone have any opinion about whether this is a valid DBIO
>technique? Most databases that are accessed over the Internet have thin-client
>interfaces implemented in front of them. I have never tried to do this from a Windows
>fat-client, and I suspect very poor performance and excess resource utilization on
>the server
>Any help or article will be appriciated
sqlsql

connecting to SQL Server 2000 from a VB.net app using ADO.net

Hi
I can connect from my app to sql server on the local lan, but I can't connec
t over the
Internet. I can't create a remote connection in Enterprise Manager. However,
I can
ping the IP address of the server just fine.
The app uses the following connect string:
Provider=SQLOLEDB;User
ID=******;Password=******;Server=******;
Database=******;Network Address=****
**
Where 'Network Address' = the IP address of the machine where SQL Server is
installed.
This connect string works great from any machine connected to the same lan a
s the
SQL Server machine. However, whenever I try to connect across the Internet (
from my
home machine, using the exact same software and connect string), I take the
following error:
Client unable to establish connection ConnectionOpen(CreateFile()
Question 1: Does anybody have any suggestions as to why I can connect over t
he LAN
but not over the Internet? I suspect some networking thing, like a firewall
on the
lan where I am trying to connect, but I am not a networking expert.
Question 2: Does anyone have any opinion about whether this is a valid DBIO
technique? Most databases that are accessed over the Internet have thin-clie
nt
interfaces implemented in front of them. I have never tried to do this from
a Windows
fat-client, and I suspect very poor performance and excess resource utilizat
ion on
the server
Any help or article will be appriciatedIn terms of connectivity issues over the Internet, firewall
issues would be my first guess. You may want to take a look
at the following article:
INF: TCP Ports Needed for Communication to SQL Server
Through a Firewall
http://support.microsoft.com/?id=287932
In terms of the application issues, it depends on the app.
The resource problems on the database server are most often
due to coding issues, not really what type of client is
used. Either can perform well or perform poorly depending on
how they are coded.
-Sue
On Thu, 15 Apr 2004 09:56:07 -0700, "Lisa Jones"
<anonymous@.discussions.microsoft.com> wrote:

>Hi
>I can connect from my app to sql server on the local lan, but I can't conne
ct over the
>Internet. I can't create a remote connection in Enterprise Manager. However
, I can
>ping the IP address of the server just fine.
>The app uses the following connect string:
>Provider=SQLOLEDB;User
> ID=******;Password=******;Server=******;
Database=******;Network Address=***
***
>Where 'Network Address' = the IP address of the machine where SQL Server is
>installed.
>This connect string works great from any machine connected to the same lan
as the
>SQL Server machine. However, whenever I try to connect across the Internet
(from my
>home machine, using the exact same software and connect string), I take the
>following error:
>Client unable to establish connection ConnectionOpen(CreateFile()
>Question 1: Does anybody have any suggestions as to why I can connect over
the LAN
>but not over the Internet? I suspect some networking thing, like a firewall
on the
>lan where I am trying to connect, but I am not a networking expert.
>Question 2: Does anyone have any opinion about whether this is a valid DBIO
>technique? Most databases that are accessed over the Internet have thin-cli
ent
>interfaces implemented in front of them. I have never tried to do this from
a Windows
>fat-client, and I suspect very poor performance and excess resource utiliza
tion on
>the server
>Any help or article will be appriciated

Thursday, March 22, 2012

Connecting to some remote Sql Server

Hi

I've got a desktop and a notebook and both are connected to the router. On both I've got Sql Server Express and Sql Server Management Studio Express installed. I need to connect to a remote Sql Server (using user ID and password) which works fine on my desktop, but fails on my notebook: Error:0 and Error: 10060.

I checked all router settings and notebook settings, but I don't know what I am doing wrong. I got myself another notebook and installed Sql Server Express plus Management Studio, which did not work either.

Hopefully someone can help.

Thank you.

The error code is of Socket error. It seems you are not able to get connected to your SQL server.

following should help you.

http://www.dameware.com/support/kb/article.aspx?ID=300060

|||

Hi, I am able to connect to the local Sql Server Express (running on the notebook) - only remote connections (at least the one I am trying) fail.

Thanks!

|||

The remote connection may be failing because of socket error. You might like to have a look at remote connection. You might also like to look at the SQL server to check if it allows remote connections.

Monday, March 19, 2012

Connecting to MDF file over Workgroup

Hi

I've build a client management (Windows) application in VS2005 which works fine on the local development machine but falls over when trying to connect to the SQL Server Express file located on a second machine on the same Workgroup. Several of the apllications will connect to the database file from networked computers.

The error I get when testing the connection or trying to connect via the App is:

-------------------
The file "Z:\BushBreaks.MDF" is on a network path that is not supported for database files.
An attempt to attach and auto-named database for file z:\bushbreaks.mdf failed. A database with the same name exists, or specified file cannot be opened or it is on a UNC share.
-------------------

How can I configure this database and/or connection to be able to allow connections to the MDF file? Please note that security is not an issue if that is at all relevant.

Many Thanks
John

Current you can't use remote database file in your SQL connection. Here is a instruction about AttachDBFileName property in connection string from MSDN:

The name of the primary database file, including the full path name of an attachable database. The path may be absolute or relative by using the DataDirectory substitution string. If DataDirectory is used, the database file must exist within a subdirectory of the directory pointed to by the substitution string.

Note:

Remote server, HTTP, and UNC path names are not supported.

For more information, you can refer to:

http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx

Thursday, March 8, 2012

connecting to an SQL2005 Server

Hi

I am trying to upgrade a system from SQL 2000 to SQL2005.

I have installed the Server on a PC with Win XP SP2. Using another PC (also Win XP SP2) on the LAN I need to ODBC to the Server.

The Server is NOT the default instance.

I cannot connect via ODBC from the Client PC. This all worked fine with SQL 2000.

As a test I also tried a fresh install of SQL2005 where it was the default instance, this worked fine.

SO the problem is when you have multiple instances.

What do I have to do to sort it out?

Cheers

Eugene

Hi,

What is a error message !? Untill you provide error message we cannot suggest you answer.

Hemantgiri S. Goswami

|||

The error is

Cannot connect to Fred\Fredsql

SQL server does not allow remote connections etc, SQL error 10060

I have used the Surface Area program and Allow remote connections is ticked

Cheers

Eugene

|||Did you had a look in the surface area for this particular instance ? These settings are configured per instance and therefore if you enabled remote connections for the default instance, it does not mean that it is enabled for the named instance as well.

HTH, jens K. Suessmeyer.

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

There are three things that you need to check for...

1) Insure remote connections is enabled for your database instance via the Surface Area Configuration tool for the named instance you are using. By default, SQL Express and DEV SKU has this disabled. Based on the error message posted, this seems to be the issue.

2) Since you are using a non-default (named) instance, this requires that the SQL Browser service to be configured and running properly.

3) Also on Windows XP SP2, you need to insure the firewall exceptions are set up properly. Here is a link with information on how to do this...

http://support.microsoft.com/default.aspx/kb/841249

Hope this helps,

Tom

This posting is provided AS IS with no warranties, and confers no rights.

Saturday, February 25, 2012

Connecting through Enterprise Manager

Hi
I am running Win2k Server on an XP machine. I have two
databases which I can run programs on with no problem. I
can connect and run queries through Query Analyzer with
no problem, but when i open Enterprise Manager to access
the Databases, the DB service stops and then I get the
message "The Connection to SQL Server has been broken.
The connection to the SQL Server is broken. Do you want
to try reconnecting to it?" I answer yes, and the prompt
for reconnecting keeps coming up. I can't access any of
my DB's through Enterprise manager. When I try to attach
a DB through the All Tasks option I get "Error 22528 [SQL-
DMO]This server connection has been unexpectedly broken
and cannot be reconnected."
Any ideas on what I need to do to rectify this problem?
Thanks
Dave LugoCheck your SQL errorlog to see if you have any stack dumps.
Cindy Gross, MCDBA, MCSE
http://cindygross.tripod.com
This posting is provided "AS IS" with no warranties, and confers no rights.

Connecting through Enterprise Manager

Hi
I am running Win2k Server on an XP machine. I have two
databases which I can run programs on with no problem. I
can connect and run queries through Query Analyzer with
no problem, but when i open Enterprise Manager to access
the Databases, the DB service stops and then I get the
message "The Connection to SQL Server has been broken.
The connection to the SQL Server is broken. Do you want
to try reconnecting to it?" I answer yes, and the prompt
for reconnecting keeps coming up. I can't access any of
my DB's through Enterprise manager. When I try to attach
a DB through the All Tasks option I get "Error 22528 [SQL-
DMO]This server connection has been unexpectedly broken
and cannot be reconnected."
Any ideas on what I need to do to rectify this problem?
Thanks
Dave Lugo
Check your SQL errorlog to see if you have any stack dumps.
Cindy Gross, MCDBA, MCSE
http://cindygross.tripod.com
This posting is provided "AS IS" with no warranties, and confers no rights.

connecting SQLExpress & Visual C# 2005

Hi

I have started to create a databse using SQL Server Management Studio Express, just a few tables, one with data. I now want to creat a some windows forms to populate the tables. However when I try to use the Add New Data Source wizard, I get an error when I try to create the connection string, but I have managed to connect to a copy of AdventureWorks located in the same parent directory.

Error is :
Unable to open the physical file "...". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
An attemp to attach an auto-named database for file ... failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

As I can connect to AdventureWorks, I presume Windows thinks the file is open, but I have no idea why, how to check, or how to close it.

TIA

Graham

Now Sorted not quite sure what I did, but I have downloaded some updates today, and I did start by looking at the data in Adveture works before I opened my project

Friday, February 24, 2012

connecting my VB database to SQL Server Managment Studio?

hi

i have created a sql database in visual studio pro and now i would like to connect to that database in SQL server managamenet studio. so when i start SQL server i connect to the same instance as my database (wich is .\SQLEXPRESS) but i can't find my database in the object explorer?

when you created the database in VB did you connect to a file rather than a database? This means that you have used a user instance, in that case the database is attached to a different instance of the server than .\sqlexpress. If you remember the path to the database then just right click on the databases folder and select attach db and then browse to the file, the db should now appear.

However I will say that once the file is attached to sql server theny ou can no longer use it as a file as I think you were, you will need to change the connection string in your VB app, you can do this using the same wizard that you you used but by selecting a different option.

Sunday, February 12, 2012

Connect to SQL Server through VPN

Hi
I've recently configured a VPN between 2 locations, using 3Com Internet Firewall 25.
It seems to be working fine, but i can't connect to a remote sql server. I've tried to do this from the managemente console, the query analyzer and a VB Application (ODBC) and i always get the same message: "The server does not exist or access denied". I'm trying to reach the server using its ip address, wich i can succesfully ping, and SQL authentication method.

If anyone has any idea, i will be really thankfull!You need to verify that port TCP 1433 and port UDP 1434 are open.

Also check for port TCP 135, that should be open if you need to make distributed queries|||Can you help us!!!!

Connect to SQL server through code?

Hi!
I have an Access db that I need to link to a SQL Server table. I'd like to
do that through code, does anyknow how to do that?
(I'd like it run from several clients and I don't want do create a
ODBC-connection on every client.)
Thx!
/e
You'd want to post this in an Access newsgroup. Or check
this Access FAQ - it has sample code for linking tables:
http://www.mvps.org/access/tables/index.html
-Sue
On Tue, 22 May 2007 21:45:08 +0200, "eric"
<eric@.hotmail.com> wrote:

>Hi!
>I have an Access db that I need to link to a SQL Server table. I'd like to
>do that through code, does anyknow how to do that?
>(I'd like it run from several clients and I don't want do create a
>ODBC-connection on every client.)
>Thx!
>/e
>

Connect to SQL server through code?

Hi!
I have an Access db that I need to link to a SQL Server table. I'd like to
do that through code, does anyknow how to do that?
(I'd like it run from several clients and I don't want do create a
ODBC-connection on every client.)
Thx!
/eYou'd want to post this in an Access newsgroup. Or check
this Access FAQ - it has sample code for linking tables:
http://www.mvps.org/access/tables/index.html
-Sue
On Tue, 22 May 2007 21:45:08 +0200, "eric"
<eric@.hotmail.com> wrote:

>Hi!
>I have an Access db that I need to link to a SQL Server table. I'd like to
>do that through code, does anyknow how to do that?
>(I'd like it run from several clients and I don't want do create a
>ODBC-connection on every client.)
>Thx!
>/e
>

connect to sql server from other computer

hi

i have 2 computers named pc1 , pc2 .

i have lan connect between this computers.

in pc1 i have server named center , in this server data base named library.

how i can connect to this database from pc2 .

note: i am working with visual basic 2005 .

please help me ,

Do you get any exception ? You just have to setup a sqlconnection via .NET and connect to the server, the simplest statement would be in C# something like:

new SqlConnection("Data Source=YourServerName;Initial catalog=library").Open()

The conenction string uses integrated authentication, I don′t know if that applies to you.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

are you programming a windows application

or ASp.net?

|||thanks alot .|||i am using windows application|||

Are these two servers in the same domain? If not, you'd better first configure the authentication mode of the SQL Server to Mixed Authentication and change the password of the sa account, which by default is blank.

After this, you can specify a connection string for the SqlConnection class in VB.NET, specifying the machine name of the sql and username and password. After this, you should be able to connect to the remote server. It is not much different from connecting to a local sql.

|||

thanks for reply .

best regards

Connect to SQL Server from ASP.Net application

Hi

I developped an ASP.Net application (with Web Dev Express ) wich attempt to connect to SQL Server Express (installed in the local machine) using Windows authentication.When i launch my application within Web Dev or from IE navigator i receive the following error message : Cannot open the database 'MyDB' login failed for user ServerName\ASPNet.I use SQL Server Management Studio Express to give the user ServerName\AspNet permission to connet to the database but i still receive the same error message.I created a user with strong password within Management Studio with connect permission and attempt to connect from my application using SQL Server authentication i receive the error message : The user 'UserName' is not associated with a trusted connection for SQL Server.Note that when i use the Connect to Database tool in Visual web dev the connection success when i use Windows authentication but fails when i use SQL Server authentication with the same error message above.My OS is WXP Pro SP2

Thanks for any help

Hi,

The message "The user 'UserName' is not associated with a trusted connection for SQL Server." is related to the fact that you are running on WIndows Authentication only. If you want to use SQL Server authentication, you will have to activate that via SQL Server Management Studio, there is an option on the server properties (Make sure you restart the service after changing that setting)

The other problem is that you have to give the user appropiate permissiosn on the database, just giving him connect permissions means that the user will not be able to access the database. He can just connect at server level. You will have to link his server principal to a database principal (by mapping the user to a database user in the appropiate database which has right to gain access to the data). if you don′t have any role to put the user in, you can just create a database user from the server user.


HTH, jens Suessmeyer.

http://www.sqlserver2005.de

|||I am seeing this error too. However I had the system running just fine with asp.net until I installed the microsoft sql server management studio express edition on my machine, now it always comes up with this error. I cannot find what has changed, I have tried to put the aspnet user login into the logins and giving them permission to everything and it still fails. What is the problem here? What is it that the management studio changes that breaks the connectivity?

Thanks,
David.|||

Thanks Jensen for help

I created an account in SQL Server Management Studio with strongly password and i've gived it necessary permissions in the database(connect, read and write) then i configured the server to connect using SQL Server authentication with the account i created , i saved the property and restarted my server like you said.But when i run Mangement Studio again and want to connect to the server using the account above i receive the following error message:

'Cannot connect to MachineName\SQLEXpress

Additionnal informations: A connection was successfully established with the server but then an error occured during the login process(provider:Shared memory, Provider error 0 -There is no process on the other extremity of the pipe. Microsoft SQL Server Error:233'

I d'ont know what this message means.Any idea?

Thanks.

Abdou

|||Hi,

could you please post your connection string in here and indiecate which Data Access components you are using for the connection to the server (wheter you use any old ADO or the new .NET Client)

HTH, jens Suessmeyer.

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

Hello Jensen

I just resolved the connection problem using SQL Server authentication.The problem was that i did'nt enable the 'Enable SQL Server authentication' checkbox in the property page of the server in 'SQL Management Studio'.Now my application works well and i connect to the server using 'SqlClient' class of NetFrameWork like this:

SqlClient conn = new SqlConnection();

string strConn = @."Data Source=(local)\SQLEXPRESS;User ID=UserName;psw=MyPWd;database=MydataBase;";

conn.ConnectionString = strConn;

Conn.Open(); etc...

Thanks of any suggestion.

Abdou

|||

Let me just add the picture if anybody is not knowing where this is located in the management tools:

http://www.sqlserver2005.de/SharedFiles/RemoteConnection.jpg

-Jens Sü?meyer.

Friday, February 10, 2012

Connect to sql server 2005 Standard thru internet

Hi!

I am trying to connect to my SqlServer 2005 thru internet, but it is not
working. I have a dyndns updater on my server which tells me an ip address
of the router. The router is configured to forward TCP port 1433 to LAN IP
address of the computer on which is SQL Server installation.
What is the connection string to connect to my server.

I tried xxx.dyndns.org:1433, but it doesn't work. There is a default
instance installed on that machine.

Please help.

ZvonkoAm Thu, 12 Jul 2007 14:09:21 +0200 schrieb Zvonko Bikup:
...

Quote:

Originally Posted by

I tried xxx.dyndns.org:1433, but it doesn't work. There is a default
instance installed on that machine.


You have to use the instance name too. If it would be a standard
installation from SQLExpress, then it would work with
xxx.dyndns.org:1433\SQLExpress.
But you said you have a "full" SQL-Server, there i don't know the name of
the standard instance.
And i hope you have enabled connect from outside of the server, by default
this is forbidden!

bye,
Helmut|||"Zvonko Bikup" <zvonko_NO_SPAM_@.velkat.netwrote in message
news:46961a92$1@.news.novi-net.net...

Quote:

Originally Posted by

Hi!
>
I am trying to connect to my SqlServer 2005 thru internet, but it is not
working. I have a dyndns updater on my server which tells me an ip address
of the router. The router is configured to forward TCP port 1433 to LAN IP
address of the computer on which is SQL Server installation.
What is the connection string to connect to my server.
>
I tried xxx.dyndns.org:1433, but it doesn't work. There is a default
instance installed on that machine.


OK. I am able to connect to my server using SQL SERVER Mangement Studio
using xxx.dyndns.org\InstanceName,1433. But when I try to connect thru PHP
script using
msssql_connect("xxx.dyndns.org\InstanceName,1433","username","password"); no
such luck. Any ideas?

Zvonko|||Zvonko Bikup (zvonko_NO_SPAM_@.velkat.net) writes:

Quote:

Originally Posted by

OK. I am able to connect to my server using SQL SERVER Mangement Studio
using xxx.dyndns.org\InstanceName,1433. But when I try to connect thru
PHP script using
msssql_connect("xxx.dyndns.org\InstanceName,1433","username","password");
no such luck. Any ideas?


Doesn't PHP use DB-Library to connect? Which version of NTWDBLIB.DLL do
you have in System32?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||"Erland Sommarskog" <esquel@.sommarskog.sewrote in message
news:Xns996C6C348C702Yazorman@.127.0.0.1...

Quote:

Originally Posted by

>
Doesn't PHP use DB-Library to connect? Which version of NTWDBLIB.DLL do
you have in System32?


In Windows\system32 there is no such file. In apache and php folder file
version is 2000.80.194.0
Is that the problem?

Zvonko|||Zvonko Bikup (zvonko_NO_SPAM_@.velkat.net) writes:

Quote:

Originally Posted by

"Erland Sommarskog" <esquel@.sommarskog.sewrote in message
news:Xns996C6C348C702Yazorman@.127.0.0.1...

Quote:

Originally Posted by

>>
>Doesn't PHP use DB-Library to connect? Which version of NTWDBLIB.DLL do
>you have in System32?


>
In Windows\system32 there is no such file. In apache and php folder file
version is 2000.80.194.0
Is that the problem?


Maybe. The latest version of the DB-Library DLL is 2000.80.2039.0 and this
is the one that ships with SQL 2000 SP4. You may want to try to get hold
of that one.

However, don't hold your breath. DB-Library is an extinct technology and
Microsoft has not done much with since SQL 6.5 was released. They added
support for named instances, although to docs say the opposite. So the
SP4 DLL may be just the same as the RTM DLL.

Furthermore, Microsoft has announced that SQL 2008, currently in beta, will
be the last version of SQL Server to accept connections from DB-Library
connections. So the PHP crowd may want to look for a new client API soon.

In the meanwhile, try adding an alias. With SQL 2005 you do that in
the SQL Configuration Manager. But whether SCM writes where DB-Library
reads, I don't know. You can also try cliconfg.exe in System32. I believe
there is one, even if you don't have SQL 2000 installed, although SQL 2000
installs a different version.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||"Erland Sommarskog" <esquel@.sommarskog.sewrote in message
news:Xns996CF06341967Yazorman@.127.0.0.1...

Quote:

Originally Posted by

In the meanwhile, try adding an alias. With SQL 2005 you do that in
the SQL Configuration Manager. But whether SCM writes where DB-Library
reads, I don't know. You can also try cliconfg.exe in System32. I believe
there is one, even if you don't have SQL 2000 installed, although SQL 2000
installs a different version.


Erland you are really something. cliconfg.exe did the trick! Whenever I had
a problem with MSSQL I posted here and Erland helped. Thanks a million
times.
I wish there would be more people like you on newsgroups in my country
(Croatia). Here people would say "just Google it". I did, as I would never
post a question if I haven't try all sources before. But some things you
just can not Google in time.

Thanks again!

Zvonko

Connect to SQL Server 2005 Express Edition using SQLDMO

Hi!
I have small testing sqldmo.vbs script to check sqldmo connectivity:
Dim srv
Set srv = CreateObject("SQLDMO.SQLServer")
srv.LoginSecure = True
srv.Connect "(local)" ' Here is error when trying to connect to Express
Edition
MsgBox srv.VersionString
Under Windows 2000 with SQL Server 2000 it works fine.
But under Windows XP with SQL Server 2005 Express Edition my test fails
with message:
Windows Script Host
--
Script: C:\sqldmo.vbs
Line: 4
Char: 1
Error: Unspecified error
Code: 80004005
Source: (null)
--
I checked version of sqldmo.dll under Windows XP. It is 2000.85.1054.0.
File with the same version is included in Microsoft SQL Server 2005
Backward Compatibility Components. So i believe my test should work with
2005 Express Edition.
What am i doing wrong?Well for one make sure your instance of Express is set to allow remote
connections and that TCPIP is enabled. But in any case I don't think DMO is
upwards compatible with any 2005 editions. While some things may work it
certainly does not know about any of the new features. I believe what the
backwards compatibility part meant was that DMO in the 2005 install can talk
to 2000 machines. For 2005 you should use SMO.
Andrew J. Kelly SQL MVP
"Igor Solodovnikov" <IgorSolodovnikov@.discussions.microsoft.com> wrote in
message news:op.s253k8mfn8ihmu@.iw2k.helpmicro.local...
> Hi!
> I have small testing sqldmo.vbs script to check sqldmo connectivity:
> Dim srv
> Set srv = CreateObject("SQLDMO.SQLServer")
> srv.LoginSecure = True
> srv.Connect "(local)" ' Here is error when trying to connect to Express
> Edition
> MsgBox srv.VersionString
> Under Windows 2000 with SQL Server 2000 it works fine.
> But under Windows XP with SQL Server 2005 Express Edition my test fails
> with message:
> --
> Windows Script Host
> --
> Script: C:\sqldmo.vbs
> Line: 4
> Char: 1
> Error: Unspecified error
> Code: 80004005
> Source: (null)
> --
>
> --
> I checked version of sqldmo.dll under Windows XP. It is 2000.85.1054.0.
> File with the same version is included in Microsoft SQL Server 2005
> Backward Compatibility Components. So i believe my test should work with
> 2005 Express Edition.
> What am i doing wrong?|||Thank you for answer. Actually now i dont need any new features of 2005
editions. I need only old features accessible through old DMO.
Actually my test already working but it started to work only after full
system reboot. Restarting services does not helped me. So now i need some
investigation to figure out which particular configuration options affect
SQLDMO connectivity.
On Tue, 10 Jan 2006 18:26:52 +0200, Andrew J. Kelly
<sqlmvpnooospam@.shadhawk.com> wrote:

> Well for one make sure your instance of Express is set to allow remote
> connections and that TCPIP is enabled. But in any case I don't think
> DMO is
> upwards compatible with any 2005 editions. While some things may work it
> certainly does not know about any of the new features. I believe what the
> backwards compatibility part meant was that DMO in the 2005 install can
> talk
> to 2000 machines. For 2005 you should use SMO.
>|||hmm, try using ".\sqlexpress" in your connect statement.|||Thank you for your hint. ".\sqlexpress" really work. But now i have system
where ".\sqlexpress" works but "(local)" does not. Why? I need "(local)"
because my application has no clue to what version of SQL Server it
connects...
On Tue, 10 Jan 2006 19:34:34 +0200, jonel.rienton@.gmail.com
<jonel.rienton@.gmail.com> wrote:

> hmm, try using ".\sqlexpress" in your connect statement.
>|||(local) is your default sql server installation, .\sqlexpress is a
named instance; as you probably know, one can have multiple instance of
sql server installation in one box.|||If you really need (local) to work for some reason, your only option is to
uninstall SQL Express and reinstall it as the default instance in the
Advanced Options section of setup.
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
<jonel.rienton@.gmail.com> wrote in message
news:1137097362.319395.67730@.g14g2000cwa.googlegroups.com...
> (local) is your default sql server installation, .\sqlexpress is a
> named instance; as you probably know, one can have multiple instance of
> sql server installation in one box.
>

Connect to SQL Server 2000 through an ASP.NET Web Application

Hi!
I am going to connect to "SQL Server 2000" through an "ASP.NET Web Application". My development environment is "Visual Studio .NET 2003". In my "Toolbox" -> "Data", I drag a "SqlConnection" and drop on the page. It would automatically be named "SqlConnection1". In its "Properties" -> "ConnectionString" -> "<New Connection...>", I would enter my Server Name (SAMIEI), select "Use Windows NT Integrated Security" and Select the Database on the Server (Northwind). Then such Connection String would automatically be generated:

"workstation id=SAMIEI;packet size=4096;integrated security=SSPI;data source=SAMIEI;persist security info=False;initial catalog=Northwind"

Now, I may see "SAMIEI.Northwind.dbo" in the "Data Connections" row of "Server Explorer" with its all "Database Diagrams", "Tables", "Views", "Stored Procedures" and "Functions".
Please take a look at the following code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Try
SqlConnection1.Open()
Catch ex As SqlException
Response.Write(ex.Message)
End Try

End Sub

It would unexceptedly encounter such error:

"Login failed for user 'NT AUTHORITY\NETWORK SERVICE'"

Please tell me the reason. I am much obliged to you for your attention.

Regards!
M.Sadegh Samiei

Hi Sadegh Samiei,

The code looks fine but connecting to SQL will fail because by default ASP.NET application will run under ASP.NET default user security context or IIS Anonymus user context. So inorder to run in others or in your security context goto web.config file set the impersonate attribute of identity element to true to run under login user security context mode if you want to run under specific user security context mode then username and password attributes in identity element

<configuration>

<system.Web>

<identity impersonate="true"/>

</system.Web>

</configuration

Regards,

Big Smile [:D]

|||

Hi,

The 'NT AUTHORITY\NETWORK SERVICE' is the ASP.NET user process used under Win Server 2003 and IIS 6. When you check the database you are working with, "Northwind", you may see that a user named ASPNET (the "user" for pre Win Server 2003) already has the necessary permissions, but you need to provide the correct permissions for 'NT AUTHORITY\NETWORK SERVICE'. If you don't have the that user set up on the database with proper permissions, you'll get a login error message - as you did. You can use SQL Server 2000's Enterprise manager to do the setup. Or you can use method suggested in the other reply. BRN..

Connect to SQL Server

Hi!
I tried to connect to SQL Server database by the following code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Try

Dim con As New SqlConnection("Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=myServerName;Connect Timeout=30")
con.Open()

Catch ex As Exception

Response.Write(ex.Message)

End Try

End Sub

And this error occured:

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

Please tell me the reason.

Regards!
M.Sadegh Samiei

checkwww.connectionstrings.com for the right connection string.