Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Friday, March 23, 2012

Remote(over a network) Database Connection Issue

This has to be an easy question.

WORK2 - My workstation (xp pro)
WORK3 - Location of SQL Express 2005

WORK3\COMPANY
sa,password

WORK3 is a XPPro, both WORK2 and 3 have full admin rights to their machines and the network, I am using SQL Authentication (sa, password)
I have used the SQL Server Config app to enable the 4 Protocols, then restarted service. I can connect locally to my database via "SQL Server Management Studio Express", and through my VB application. I have checked "allow remote connections" in the database properties.
I do not know what i am missing? any thoughts?

Thanks in Advance

Are

you using a connection string? which is?|||

Are you using a connection string? which is?

|||

My VB6 connectionstring is:

This works PERFECT when the data souce is a local SQL Express Database

mstrProvider = "SQLNCLI.1" 'SQL Server 2005 Express

mstrPassword ="password"

mstrDataSource =<my database name>

goSQLDataSource= "WORK/SQLSERVER"

ConnectString = "Provider=" & mstrProvider & ";" & _
"Persist Security Info= False" & ";" & _
"Integrated Security=SSPI" & ";" & _
"User ID=sa" & ";" & _
"Password=" & mstrPassword & ";" & _
"Initial Catalog=" & mstrDataSource & ";" & _
"Data Source=" & goSQLDataSource

When i use the SS Management Studio i cant connect to a remote SQL Server even though the allow remote connection is enbled.

|||

How is your authentication mode? if you are using a sql logins like a "sa", the authentication mode must be "sql server and windows authen....."

|||

are you refering to this?

"Integrated Security=SSPI" & ";" & _

I am always going to use SQL Authentication...Local or remote.

When I use SSMS i have to change it from Windows Auth to SQL b/c it doesnt let you enter a password if you are using Windows.

Does that answer your question?

|||

Sorry, when I told verify the authentication mode I mean on the SQLserver configuration properties.

|||

Verify the authentication mode on <INSTANCE>\properties\security\server authentication...

|||

The option button is select for "SQL Server and Windows Authentication mode" under the Server Properties/security

|||Why does Microsoft have to be so difficult? lol...sorry just venting|||

Verify this other one option <INSTANCE>\properties\connections\"alow remote connection s to this server"

|||

Maximum number of concurrent connections=0

Use query gov. = unchecked

default connection options= all unchecked

allow remote connections to this server=checked

remote query timeout=0

require distrubited transactions=unchecked

Configured values=selected

sql

Remote User Connection to SQL Server 7 Standard Edition

Is it possible to connect a remote user (in a wide area network) to a
database running on SQL Server 7 Standard Edition.
Do I need the Enterprise Edition to accomplish this?
Yes (to the first)
and
No (to the second)
Mike John
"guez" <guez@.discussions.microsoft.com> wrote in message
news:C4A2552E-74CA-4DDF-A1D1-4A1E05FB773C@.microsoft.com...
> Is it possible to connect a remote user (in a wide area network) to a
> database running on SQL Server 7 Standard Edition.
> Do I need the Enterprise Edition to accomplish this?

Remote User Connection to SQL Server 7 Standard Edition

Is it possible to connect a remote user (in a wide area network) to a
database running on SQL Server 7 Standard Edition.
Do I need the Enterprise Edition to accomplish this?Yes (to the first)
and
No (to the second)
Mike John
"guez" <guez@.discussions.microsoft.com> wrote in message
news:C4A2552E-74CA-4DDF-A1D1-4A1E05FB773C@.microsoft.com...
> Is it possible to connect a remote user (in a wide area network) to a
> database running on SQL Server 7 Standard Edition.
> Do I need the Enterprise Edition to accomplish this?

Remote User Connection to SQL Server 7 Standard Edition

Is it possible to connect a remote user (in a wide area network) to a
database running on SQL Server 7 Standard Edition.
Do I need the Enterprise Edition to accomplish this?Yes (to the first)
and
No (to the second)
Mike John
"guez" <guez@.discussions.microsoft.com> wrote in message
news:C4A2552E-74CA-4DDF-A1D1-4A1E05FB773C@.microsoft.com...
> Is it possible to connect a remote user (in a wide area network) to a
> database running on SQL Server 7 Standard Edition.
> Do I need the Enterprise Edition to accomplish this?sql

Wednesday, March 21, 2012

Remote synchronise from PDA to SQL Server 2005

What is the best way to synch with a very large database (e.g. 40,000 products in Inventory Master) in connection oriented way and also offline mode for remote synchronizing the Data from PDA to SQL Server 2005. Kindly provide us some of the best practices on this concept.

Thanks

I answered the same question from you in other forum "SQL Server Replication"

Thanks,
Laxmi

sql

Remote SSIS connection problem

we are trying to remotely adminiter SQL 2005 installed on Server B (actual server names are diferent) from SQL Server Manamagement Studio installed on Server A.

We can connect to everything else except SSIS. When we try to connect to SSIS, it says:

Cannot Connecto to B
Additional Information:
Failed to retrieve data fro this request. (Microsoft.SqlServer.SmoEnum)
Conecct to SSIS Server on machine "B" failed:
The RPC server is unavailable
.
Conecct to SSIS Server on machine "B" failed:
The RPC server is unavailable

from connection dialog on A, we have tried putting FDQN of B.
we are using windows authentication with domain account.

per one of the suggestions, we modified MsDtsSrvr.ini.xml to change the ServerName for MSDB to be one fo the following:
B, .\MSSQLSERVER, B\MSSQLSERVER, .

we also went to DCOM settings of MsDtsServer, under security, Customize for selected for all three Permissions, and under customize settings, B\Administrators was given full access for everything.

also the domain user was added to both machines in the administrators group.

i'll appreciate any ideas.Might there be a firewall enabled on machine B?|||Both are windows 2003 boxes with no firewalls. there is a firewall in between box b and a, and we requested hosting services to open ports 135, and 3882 which they did. we have emailed them back today to make sure that the ports were indeed opened.

btw, i am with mcs. i posted it here since i wasnt sure who to direct this question to, since i did not have any internal BI contacts. i am working on this issue with a client.

Thanks
Ali|||

We are using DCOM, not RPC and port 135 may not be enough.

This port serves as RPC endpoint for initial service discovery, but then the client should be able to communicate via (randomly assigned) port used by MsDtsSrvr.exe

|||

If it always picks a random port, do we have to resort to what is specified in this article (static end points for DCOM ) http://weblogs.asp.net/rhurlbut/archive/2004/03/07/85542.aspx so we can open only 2 ports (or a range of ports in the firewall) ?

|||Or, can we configure a static endpoint for the MsDtsServer.exe from the application properties under component services? is that same as setting the registry to configure port settings?

Thanks
Ali|||

Yes, it creates the same registry key.

|||I have the same problem. Did you find a resolution ? I can connect from my desktop to Analysis Services and Database Engine, just not to SSIS. I haven't seen a useful answer to this anywhere !!!|||

Hi,

I dont know exactly why this error comes but i solved it by removing the server name from the named pipes.

\\.\pipe\sql\query and entered this value in the named pipes field.

and i started working.

from

sufian

Remote SSIS connection problem

we are trying to remotely adminiter SQL 2005 installed on Server B (actual server names are diferent) from SQL Server Manamagement Studio installed on Server A.

We can connect to everything else except SSIS. When we try to connect to SSIS, it says:

Cannot Connecto to B
Additional Information:
Failed to retrieve data fro this request. (Microsoft.SqlServer.SmoEnum)
Conecct to SSIS Server on machine "B" failed:
The RPC server is unavailable
.
Conecct to SSIS Server on machine "B" failed:
The RPC server is unavailable

from connection dialog on A, we have tried putting FDQN of B.
we are using windows authentication with domain account.

per one of the suggestions, we modified MsDtsSrvr.ini.xml to change the ServerName for MSDB to be one fo the following:
B, .\MSSQLSERVER, B\MSSQLSERVER, .

we also went to DCOM settings of MsDtsServer, under security, Customize for selected for all three Permissions, and under customize settings, B\Administrators was given full access for everything.

also the domain user was added to both machines in the administrators group.

i'll appreciate any ideas.Might there be a firewall enabled on machine B?|||Both are windows 2003 boxes with no firewalls. there is a firewall in between box b and a, and we requested hosting services to open ports 135, and 3882 which they did. we have emailed them back today to make sure that the ports were indeed opened.

btw, i am with mcs. i posted it here since i wasnt sure who to direct this question to, since i did not have any internal BI contacts. i am working on this issue with a client.

Thanks
Ali|||

We are using DCOM, not RPC and port 135 may not be enough.

This port serves as RPC endpoint for initial service discovery, but then the client should be able to communicate via (randomly assigned) port used by MsDtsSrvr.exe

|||

If it always picks a random port, do we have to resort to what is specified in this article (static end points for DCOM ) http://weblogs.asp.net/rhurlbut/archive/2004/03/07/85542.aspx so we can open only 2 ports (or a range of ports in the firewall) ?

|||Or, can we configure a static endpoint for the MsDtsServer.exe from the application properties under component services? is that same as setting the registry to configure port settings?

Thanks
Ali|||

Yes, it creates the same registry key.

|||I have the same problem. Did you find a resolution ? I can connect from my desktop to Analysis Services and Database Engine, just not to SSIS. I haven't seen a useful answer to this anywhere !!!|||

Hi,

I dont know exactly why this error comes but i solved it by removing the server name from the named pipes.

\\.\pipe\sql\query and entered this value in the named pipes field.

and i started working.

from

sufian

Remote SQL with proxy on server

Hello
I'm connecting to DB SQL server from my Access XP using
DSN User, but on my network I have a proxy, so it's block
my connection and I'm enable de connect,
How can I depass a proxy to connect from Access to a
remote DB SQL
ThanksDoes this article help
http://support.microsoft.com/default.aspx?scid=kb;en-us;216415
--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.orgsql

remote sql server connection

Hi all,
I am trying to connect to remote sql server in vb.net application.
I am getting an error "login failed for user'abc' ".
why am I getting this error, what could be the possible reason.
any help will be appreciated.what is the login and password in your database?
whats ur connection string in vb.net?|||http://www.freevbcode.com/ShowCode.asp?ID=2226 a template to perform the task.

What is the connection string set and SQL server authentication?|||Originally posted by deidei76
what is the login and password in your database?
whats ur connection string in vb.net?

login: abc
password: abc

"data source=IP address of server;initial catalog=databasename;persist security info=False;user id=abc;workstation id=WSID;packet size=4096"|||Originally posted by Satya
http://www.freevbcode.com/ShowCode.asp?ID=2226 a template to perform the task.

What is the connection string set and SQL server authentication?
thanks satya.I am able to connect to the server now. simple and stupid mistake.I forgot to mention password in connection string.

Remote SQL connection

Hello everyone, I am trying to connect to a remote SQL 2005 database from Microsoft SQL Server Management Studio.
I enabled the remote connection on the server and creating a user on the server.
I am trying to connect to the server from my workstation using sql server authentication with the login name already created on the server.

I am receiving this error: cannot connect to "server name"
cannot open user default database. Login failed.
Login failed for user "username".(Microsoft SQL Server, Error: 4064)

Can anyone help?

under your server registration properties... do you have authentication set to "SQL Server Authentication"?

You aren't behind a firewall that blocks connections to your remote? (they do this on corporate networks)...

Remote SQl connection

I have a SQL server that was formatted and reconfigured. Prior to the
format, I was able to access this server from remote locations by creating a
n
ODBC connection in Administrative Tools in Windows XP. I haven't changed my
firewall or the server IP. As far as I can see, everything should be the
same. The problem now is that I can't create an ODBC connection unless I'm
on my network and a member of the domain. Even if I'm with my network, but
not a member of the domain, I can't create the ODBC connection.
The server is set up using mixed-mode authentication and as I mentioned, I
can create this connection if I'm on the domain. Any suggestions as to why
I
can't do this remotely? Thanks in advance for your help.Hi
Can you see the server (using ping?). Which protocols do you have enabled?
Is the SQL Server on the domain? Have you re-created the users, logins and
trusts to be exactly the same? What error message do you get?
John
"J.B.C" <JBC@.discussions.microsoft.com> wrote in message
news:F9887DA2-34B9-42F2-A903-CBF04CE9DDD7@.microsoft.com...
>I have a SQL server that was formatted and reconfigured. Prior to the
> format, I was able to access this server from remote locations by creating
> an
> ODBC connection in Administrative Tools in Windows XP. I haven't changed
> my
> firewall or the server IP. As far as I can see, everything should be
> the
> same. The problem now is that I can't create an ODBC connection unless
> I'm
> on my network and a member of the domain. Even if I'm with my network,
> but
> not a member of the domain, I can't create the ODBC connection.
> The server is set up using mixed-mode authentication and as I mentioned, I
> can create this connection if I'm on the domain. Any suggestions as to
> why I
> can't do this remotely? Thanks in advance for your help.

Tuesday, March 20, 2012

Remote SQl connection

I have a SQL server that was formatted and reconfigured. Prior to the
format, I was able to access this server from remote locations by creating an
ODBC connection in Administrative Tools in Windows XP. I haven't changed my
firewall or the server IP. As far as I can see, everything should be the
same. The problem now is that I can't create an ODBC connection unless I'm
on my network and a member of the domain. Even if I'm with my network, but
not a member of the domain, I can't create the ODBC connection.
The server is set up using mixed-mode authentication and as I mentioned, I
can create this connection if I'm on the domain. Any suggestions as to why I
can't do this remotely? Thanks in advance for your help.Hi
Can you see the server (using ping?). Which protocols do you have enabled?
Is the SQL Server on the domain? Have you re-created the users, logins and
trusts to be exactly the same? What error message do you get?
John
"J.B.C" <JBC@.discussions.microsoft.com> wrote in message
news:F9887DA2-34B9-42F2-A903-CBF04CE9DDD7@.microsoft.com...
>I have a SQL server that was formatted and reconfigured. Prior to the
> format, I was able to access this server from remote locations by creating
> an
> ODBC connection in Administrative Tools in Windows XP. I haven't changed
> my
> firewall or the server IP. As far as I can see, everything should be
> the
> same. The problem now is that I can't create an ODBC connection unless
> I'm
> on my network and a member of the domain. Even if I'm with my network,
> but
> not a member of the domain, I can't create the ODBC connection.
> The server is set up using mixed-mode authentication and as I mentioned, I
> can create this connection if I'm on the domain. Any suggestions as to
> why I
> can't do this remotely? Thanks in advance for your help.

Remote SQl connection

I have a SQL server that was formatted and reconfigured. Prior to the
format, I was able to access this server from remote locations by creating an
ODBC connection in Administrative Tools in Windows XP. I haven't changed my
firewall or the server IP. As far as I can see, everything should be the
same. The problem now is that I can't create an ODBC connection unless I'm
on my network and a member of the domain. Even if I'm with my network, but
not a member of the domain, I can't create the ODBC connection.
The server is set up using mixed-mode authentication and as I mentioned, I
can create this connection if I'm on the domain. Any suggestions as to why I
can't do this remotely? Thanks in advance for your help.
Hi
Can you see the server (using ping?). Which protocols do you have enabled?
Is the SQL Server on the domain? Have you re-created the users, logins and
trusts to be exactly the same? What error message do you get?
John
"J.B.C" <JBC@.discussions.microsoft.com> wrote in message
news:F9887DA2-34B9-42F2-A903-CBF04CE9DDD7@.microsoft.com...
>I have a SQL server that was formatted and reconfigured. Prior to the
> format, I was able to access this server from remote locations by creating
> an
> ODBC connection in Administrative Tools in Windows XP. I haven't changed
> my
> firewall or the server IP. As far as I can see, everything should be
> the
> same. The problem now is that I can't create an ODBC connection unless
> I'm
> on my network and a member of the domain. Even if I'm with my network,
> but
> not a member of the domain, I can't create the ODBC connection.
> The server is set up using mixed-mode authentication and as I mentioned, I
> can create this connection if I'm on the domain. Any suggestions as to
> why I
> can't do this remotely? Thanks in advance for your help.

Remote SQL

Hello everyone, I am trying to connect to a remote SQL 2005 database from Microsoft SQL Server Management Studio.
I enabled the remote connection on the server and creating a user on the server.
I am trying to connect to the server from my workstation using sql server authentication with the login name already created on the server.

I am receiving this error: cannot connect to "server name"
cannot open user default database. Login failed.
Login failed for user "username".(Microsoft SQL Server, Error: 4064)

Can you help?

Whilst you created an account on the machine, have you granted that account access to its default database which hopefully is your application database?

Also, you can investigate what the connection string should be like:

1) Create an empty text file in windows explorer and rename it to X.UDL
2) Double click on it and the datalink provider dialog will appear.
3) Select the provider tab. Find the provider for SQL Server express and click next.
4) Select your database and select integerated authentication.
5) Test the connection and save it.
6) Compare the contents of X.UDL with your connections string.

You could try looking on http://www.connectionstrings.com/ for examples of connection strings.
HTH

|||Sounds like the server is not configured correctly. Can you connect with the sql server management studio?

Remote server setting -- Urgent

I have a sql2k clustered server. now this server need remote server connection to other server. I have set up remote server on both site, but only one way works: connection to clustered server is ok while from clustered server I can not get the remote sit
e. error msg:
Server: Msg 17, Level 16, State 1, Line 1
SQL Server does not exist or access denied.
I am sure network access to 1433 port on both virtual server IP and remote server IP is OK Do I still need to open 1433 port on each node of clustered server to remote server?
Pls help.
Thanks
George
If the remote server is in another forest/domain you may need a two-way trust between the domains. What forest + domain functionality level are they both running? (eg W2K mixed, W2K native, W2K3 native etc). Can you browse the Active Directory objects i
n the remote site (from both directions) using dsa.msc? If you can you don't have a trust problem. If the trusts are okay (or both servers are in the same domain) then you can add the SQL Server service account from one server to the local admins group
of the other (just as a test!). If this fails then you know you have bigger problems on your WAN than just SQL Server and permissions.
|||Thanks Stephen. But I can not see active directory; and the remote server is in a workgroup, not a domain.
pls advise, thanks a lot
George

remote server connection problems

Having all kinds of problems trying to establish a connection between a VB5 application and a remote server Sql Express database. The connection works fine with a user instance on my local machine. At one time I did have the remote connection working successfully using Sql Server authentication, whereby the application was passing the login and password through the connection string as so:

Provider=SQLNCLI.1;Persist Security Info=False;Data Source=<server name>\sqlexpress;Database=<database name>;Uid=<userid>;Pwd=<password>;

I've been away from using this development database for several weeks. Things are little foggy from that initial effort, and I recently tried putting up a newer copy of the development database on this server from my local machine copy. That local database copy apparently didn't have authentication login/user used by the app, so I created the Login account and assigned the default database, then created the User account, referenced it to the Login account, and gave the user account a role as db_owner. Now when my app attempts to connect with aforementioned connect string, I get an error "Login failed for '< userid>'. I've redone this thing a hundred times and I still get this error. I did put a Windows Update on this server recently so don't know if that's an issue.

I could try using Windows authentication mode, but am not sure how to establish Logins/Users under this mode. Mainly, I'm don't know what the name of these accounts should be. Do you set the Windows login name up in both Login and User accounts? Below is a modified connect string I'd probably use for this mode:

Provider=SQLNCLI.1;Persist Security Info=False;Integrated Security=SSPI;Data Source=<servername>\sqlexpress;Database=<database name>;

Any ideas or suggestion on things to try on either of these modes? At my wits on this and am up against the clock.

TIA ... Rick

If you're using SQL Authentication, the error would suggest that the UserID you're passing in your connection string either doesn't exist as a Login on the Server or that the Login does exist, but it isn't associated with a specific database User. You could probably find out the exact cause by looking in the error log, where it will list not only the error message, but the specific State. If you're getting the 18456 login error, the meaning of the common states can be found in this blog entry.

If you haven't read the Books Online topics covering security already, you should stop what your doing and go read them. No explaination provided in this forum is a subsitute for an actual understanding of the technology.

Regardless of the type of authentication you use, you need both a Login and a User in order to do anything in a database. The Login is what gives you access to the Server while the User is what gives you permission in the database. In Windows Auth, the Login is always associated with either a Machine or Domain User or Group, while SQL Auth Logins can just be any arbitrary name you want to give it. The Database user can be named pretty much anything you want to call it, you make the association between a Login and a User either using Management Studio UI or T-SQL commands. Here is a Windows Auth example:

Login - Domain\Rick (A Windows domain user)

Database User - Rick

You would associate the Domain\Rick Login with the Database User named 'Rick'. You would assign specific permissions in your database to the user named Rick, not to the Login. To be clear, I could have named the user Mike and it wouldn't make a difference. The Database User is totally separate from the Login and from the Windows Users in your domain. This is all explained in Books Online.

Mike

|||Hey Mike,

Mike Wachal - MSFT wrote:

If you're using SQL Authentication, the error would suggest that the UserID you're passing in your connection string either doesn't exist as a Login on the Server or that the Login does exist, but it isn't associated with a specific database User.

Neither of these is true. The Login account exist, default database selected as application database, password set, User account created that points to Login account of the same name, role given as db_owner. It should work. It does not.


You could probably find out the exact cause by looking in the error log, where it will list not only the error message, but the specific State. If you're getting the 18456 login error, the meaning of the common states can be found in this blog entry.[

It goes back and forth haphazardly between state 16 and state 8. Now it's consistently state 16 with a "cannot open database" error. What other permissions are there to give to this thing?

In another connectivity test, there was another oddity. Using Crystal Reports XI, I attempted to create a connection using OLE DB ADO. Selected "Provider for Sql Server" (note: couldn't get a connection out of their Sql Native Client option), logged into the database as SA. However, the application tables belonging to the database were not visible. Everything should be visble and available to SA, right?

Here's what I've been doing to move a copy of the local database up to a development test server, using SqlExpress Manager:

- Detach local db
- Detatch server db and deleted existing MDF/LDF pair since I'm going to overwrite these.
- Copy MDF/LDF pair up to server
- Attach pair to server
- Rename database, removing full pathname from database name.
- Create Login account used by app as Sql Server authentication and establish default db for app. Note, this login seems to persist each time I perform this sequence. Doesn't seem to make a difference if I use what's there, or delete it and start fresh.
- Create User account of same name and point Login Account. Assign role as db_owner.
- Reattach app database on local machine to it's available there again.

This should work, and I had it working once before. Windows authentication mode isn't allowing a connection either. As it is, I've spent a few days on this, am frustrated, and about ready to give up on SqlExpress and move on MySql.

Supplement: I just uninstalled and reinstalled SqlExpress and Sql Native Client on the server. I didn't remove any of the extra tools and such. After successful installation I was going to reconfigure for remote access, however, all my settings were still configure for remote access. I restarted the service(s), including Sql Browser. Ran the process of moving a copy of the database over to server (again), attached, and ... same old error ... "cannot open database", both with Sql and Windows authentication.

Rick

|||Mike,

Well, after three days of troubleshooting, the problem turned out to be that the database name in the connection string must explicitly reference the .MDF extension. For example...

Problematic connect string:
connection=Provider=SQLNCLI.1;Persist Security Info=False;Data Source=<server name>\sqlexpress;Database=myDatabase

Working connection string

connection=Provider=SQLNCLI.1;Persist Security Info=False;Data Source=<server name>\sqlexpress;Database=myDatabase.mdf

To the best of my recollection, Sql Server doesn't normally require an extension, but apparently Sql Express now does.

Rick|||

SQL Express does not require the extention, but it does require the correct name. SQL Server will also keep a hold of the name of a database and tie it to a specific file location, even after detach. Database names can be pretty much anything, including a full path to a file, in fact, when you use AttachDbFilename and don't specificy an explicit name, your database will actually be given an "auto name" that is the path to the file.

It appears that at some point in the past, the file managed to get named as the file name with extenstion rather than just the base file without extention. Since that informaiton is cached in some form in the Master database, the next time you attached a database from the same path, it "picks up" to name from the previous attach. This isn't unique to SQL Express, any copy of SQL Server could do this.

If you look in Management Studio at the server, you should find the database name listed as myDatabase.mdf. You should be able to change this if you want by just renaming the database.

Mike

|||Yeah, I thought about it some more overnight. When moving the local copy up to server and renaming the file (removing the full path from the name), I didn't remove the .MDF extension. So, just have to be mindful of this in future when attaching any database to the server.

Remote server connection

We have a database on a shared SQL Server stored on our ISP's server. I can
connect to this via Enterprise Manager from our office, but when I try the
same from Enterprise Manager on my PC at home I get the following message:

A connection could not be established to MFSERVER.

Reason: SQL Server is not running or access denied.

Any ideas?

ThanksHi

There is probably a firewall blocking port 1433.
Check with your network administrators.

Regards
----------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: mike@.epprecht.net

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/

"Mark Fisher" <mfisher@.uku.co.uk> wrote in message
news:%wGud.1214$uv1.177@.newsfe1-gui.ntli.net...
> We have a database on a shared SQL Server stored on our ISP's server. I
can
> connect to this via Enterprise Manager from our office, but when I try the
> same from Enterprise Manager on my PC at home I get the following message:
> A connection could not be established to MFSERVER.
> Reason: SQL Server is not running or access denied.
> Any ideas?
> Thanks

Monday, March 12, 2012

Remote ODBC Connection problem \

Hi

I think i have a very unique issue ...

Running 2 machines
Win2000 / WinXP
Both have Sql / Service packs
Identical ODBC Setup

The issue is as follows :
Both machines CAN access The internet server through ODBC ! (so i dont
think the problem lies here)
I CAN connect to a server on the internet through a local web page on
W2k Box; BUT NOT on the WINXP machine ?
I think there is a IIS Prob maybe .. Checked iUser Security settings on
both and are identical

Any 1 have a suggestion ?

Thanks in advancelighthammer (lighthammer@.webmail.co.za) writes:
> I think i have a very unique issue ...
> Running 2 machines
> Win2000 / WinXP
> Both have Sql / Service packs
> Identical ODBC Setup
> The issue is as follows :
> Both machines CAN access The internet server through ODBC ! (so i dont
> think the problem lies here)
> I CAN connect to a server on the internet through a local web page on
> W2k Box; BUT NOT on the WINXP machine ?
> I think there is a IIS Prob maybe .. Checked iUser Security settings
> on both and are identical

I'm having a hard time to understand what you are connecting to. Is
"the internet server" and "a server on the Internet" the same machine?
Where does IIS comes into the picture? (Warning: I know next to nothing
about IIS.)

What error messages do you get?

Could the Windows firewall have anything to do with it?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Friday, March 9, 2012

Remote MSSQL2000 server connection with .net

I have a problem in connecting to my hosting database using .net file.
I am able connect to database with my ASP page.

Any sugession is greately appretiated!

Here is my code:

".net" page:


<%@. page language='vb' debug='true' %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<html>
<script runat="server"
Sub Page_Load(Src As Object, E As EventArgs)
Dim MyConnection As SqlConnection
Dim da AS sqlDataAdaptor
Dim ds As DataSet
MyConnection = New SqlConnection("DSN=***;UID=***;PWD=***")
da = new sqlDataAdaptor("select * from city", MyConnection)
Try
MyConnection.open()
Response.write "Connection Success " & MyConnection.Database & "<br>"
catch sx AS sqlException
Response.write "Connection successful: <br>"
End Try

ds=new Dataset()
da.Fill(ds, "City")

With DataGrid1
.DataSource = ds.Tables("city").DefaultView
.DataBind()
End With

MyConnection.Close()

End Sub

</script
<body
<p>
<ASP:dataGrid id='DataGrid1' runat='server'/>
<p>
</body>
</html>
--------------


"ASP" page:

Set DB = Server.CreateObject("ADODB.Connection")
DB.Open ConnectionString

SET RSCheckeMail = DB.Execute ("select * from city")

While not RSCheckeMail.eof
Response.write "City: " & RSCheckeMail("Name") & "<br>"
RSCheckeMail.Movenext
Wend


Thanks for your help in advance.Please any help on this?|||As far as I understand it, in order to use a DSN in the connection string you have to use the ODBC provider, which is not recommended. You really need to try to use SQLClient.

Please check out the connection string suggestions athttp://www.connectionstrings.com. I would think that you would need to connect using an IP address.

Terri|||tmorton,
Thank you for your suggestion. I am trying with SQLClient only or I am missing some thing here.
I tried with all the connection strings explained in the URL: http://www.connectionstrings.com. No luck.

Any more suggestions? please.

KP|||can you post the updated code ?|||Yes, you are using SQLClient, which is good. What I was trying to say but wasn't clear is that if you want to use a DSN you would need to use ODBC instead.

Did you try a connection string in this format?
"Data Source=190.190.200.100;Network Library=DBMSSOCN;Initial Catalog=yourDatabase;User ID=yourSQLUserID;Password=youSQLUserPassword;"

If you could post your attempted connection string and any errors your are receiving this would help to troubleshoot the problem.

Terri|||tmorton,
Thank you for your advice.

I got the solution for my problem.

I think all new .net learners like me has this problem initially. I mistake I did was, not using VS .net to start my development.
All beginners you need to remember to do this when you start for the first time when you start running some sample .net pages: Create an application (vb or c#) depends as per your preference. Then add all the pages to that Application. This will make your test pages will run properly (you won't waste time like me for 3 days to scratch your head to run a simple page!!).

Here is my final code to connect remote server from your IIS:


<%@. page language='vb' %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %
<script runat="server"
Sub Page_Load(Src As Object, E As EventArgs)
Dim MyConnection As SqlConnection
Dim da AS sqlDataAdapter
Dim ds As DataSet
MyConnection = new SqlConnection("server=65.49.254.24;database=aspdotnet;uid=aspdotnetuser;pwd=aspdotnetpassword")

da = new sqlDataAdapter("select * from city", MyConnection)
Try
MyConnection.open()
Response.write ("Connection Success <br>")
catch sx AS sqlException
Response.write ("Connection failed: <br>")
End Try

ds=new Dataset()
da.fill(ds, "cities")

With DataGrid1
.DataSource = ds.Tables("cities").DefaultView
.DataBind()
End With
MyConnection.Close()
End Sub

</script>
<html>
<body
<p>
<ASP:dataGrid id='DataGrid1' runat='server'/>
<p>
</body>
</html>

Please correct me if you can improve the connection.

Thanks for your support.

KP|||this is good...works..but if you just want to display a set of results...you can use executereader (for returning multiple columns) which is faster than datasets...am sure you will learn along the journey...

in your case you could have just created an sqlcommand...xample..( off the top of my head)


dim mysqlcommand as sqlcommand
Dim conn As SqlConnection
dim strsql as string
conn="..."
strsql ="Select * from table"
mysqlcommand=new sqlcommand(strsql,conn)
conn.open()
datagrid.datasource=mysqlcommand.executereader()
conn.close()

also remember to open the connection late and close early...

hth|||Dinakar,
Thanks for your suggestions. I will remember them.
You are right! Just now I started long journey...

KP

Remote MSDE Connection string?

For a SQL Server 2000 connection string I usualy use the following format:

server=somewhere.com;uid=sa;password=sa;database=myDB

or:

server=66.33.11.123;uid=sa;password=sa;database=myDB

However, now I am dealing with a remote MSDE database. What is the format to connect to a remote MSDE database? Is it:

server=<IPADDRESS>\<INSTANCENAME>;uid=sa;password=sa;database=myDB

Where <IPADDRESS> is the Ip address of the remote machine and <INSTANCENAME> is the MSDE instance name. Is this correct? If not, what am I doing wrong?I've used the <MACHINENAME>\<INSTANCENAME> successfully before, but I'm not sure about the <IPADDRESS>\<INSTANCENAME> combo.|||I would only think that I can use the <MACHINENAME>\<INSTANCENAME> way if the machine was on my local area network. But the machine is not, it's on a remote network on the internet. So I couldn't use <MACHINENAME>\<INSTANCENAME> because how would it find that machine unless it had an IP address?|||you need the ip address, and have that msde server accessible through their firewall.|||So,... in other words,.. I was right,... the correct way to access it is:

server=<IPADDRESS>\<INSTANCENAME
correct?