Thursday, March 29, 2012
DSN Setting
web site, in the DSN setting of web server side, I am
using DB server's DNS entry for the server name, it
worked properly, and some days ago, when some setting of
our LAN changed, I find this DNS entry can't be used, but
I still can ping that DB server using the same DNS name.
any hint for this problem?if you can ping that DNS name then you should be able to
connect to it through a DSN, try to run this command on a
DOS command prompt:
telnet <dns name of the db server> 1433
if you see a blank screen that means you are connected to
sql server on port 1433 and there is no network
connectivity issue, otherwise you should get an error.
Please also give us more details about your environment,
OS, service packs, mdac version etc. If you can provide us
details of network configuration on db and http servers
then that would really help. Connecting to sql server is
pretty straight forward task if network configuration is
right. Sometime comapnies put even internal webserver on a
DMZ, which would require more network configuration to be
able to connect to a db server inside firewall.
hth.
>--Original Message--
>I have a sql2k inside LAN, which is used for a intranet
>web site, in the DSN setting of web server side, I am
>using DB server's DNS entry for the server name, it
>worked properly, and some days ago, when some setting of
>our LAN changed, I find this DNS entry can't be used, but
>I still can ping that DB server using the same DNS name.
>any hint for this problem?
>.
>
DSN Problems
The DSN does not retain the password field entry I make. I enter the
password (the sql login is already there), click next, next then ok.
When I reopen the DSN, the password table is blank again. Help
appreciated.
Thanks,
Frank
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!"Frank Py" <fpy@.proactnet.com> wrote in message
news:3fd614b8$0$196$75868355@.news.frii.net...
> I have a SQL Server 2000 system dsn that uses SQL Server authentication.
> The DSN does not retain the password field entry I make. I enter the
> password (the sql login is already there), click next, next then ok.
> When I reopen the DSN, the password table is blank again. Help
> appreciated.
> Thanks,
> Frank
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Passwords are not stored in DSNs, as it would be very insecure. You will
need to specify the password (and perhaps username - I'm not sure) at
connection time. This is one good argument for using Windows authentication,
if that's possible in your case. If not, you will need to investigate how to
modify your application to request a username/password from the user.
One other possibility would be to use some sort of middle tier, which would
use a single DSN for all connections to SQL Server, but this may not be
practical or desirable, depending on your application setup.
Simon|||Yes, I can use Windows Authentication. The person connecting to the DSN
is an administrator. So if I use Windows Authentication instead on this
DSN, would that be more transparent to the user? The user, who is an
administrator needs to run a Crystal Report that is connected to the DSN
without being prompted for a username and password each time. Help
appreciated. Thanks.
Frank
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||Frank Py <fpy@.proactnet.com> wrote in message news:<3fd635b0$0$198$75868355@.news.frii.net>...
> Yes, I can use Windows Authentication. The person connecting to the DSN
> is an administrator. So if I use Windows Authentication instead on this
> DSN, would that be more transparent to the user? The user, who is an
> administrator needs to run a Crystal Report that is connected to the DSN
> without being prompted for a username and password each time. Help
> appreciated. Thanks.
> Frank
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Yes - using Windows authentication means that no username and password
should be required, in the same way as connecting with Query Analyzer
or OSQL, for example.
Simon
DSN or DSNless connection?
beginning I'm going to use Access database with tables linked to SQL Server
tables. Then form by form are going to be moved to direct SQL Server
connection. When all of them are moved I delete Access. I have very weak
experience with SQL Server, so I even do not know advantages and
disadvantages of DSN and DSN less connections. I know that I have to learn
everything and I'm going to do that. But for the beginning could somebody
give me some suggestions regarding connection. What is better ? DSN or DSN
less?
Thank you
Vladhttp://groups.google.com/groups?q=dsn+vs+dsn-less
-oj
http://www.rac4sql.net
"Vlad" <vovan.c@.verizon.net> wrote in message
news:O5fGXDjAEHA.2180@.TK2MSFTNGP09.phx.gbl...
> I'm starting to move my VB6 application from Access to SQL Server. In the
> beginning I'm going to use Access database with tables linked to SQL
Server
> tables. Then form by form are going to be moved to direct SQL Server
> connection. When all of them are moved I delete Access. I have very weak
> experience with SQL Server, so I even do not know advantages and
> disadvantages of DSN and DSN less connections. I know that I have to learn
> everything and I'm going to do that. But for the beginning could somebody
> give me some suggestions regarding connection. What is better ? DSN or DSN
> less?
> Thank you
> Vlad
>|||Thank you very much
Vlad
"oj" <nospam_ojngo@.home.com> wrote in message
news:OYlwjdlAEHA.2448@.TK2MSFTNGP12.phx.gbl...
> http://groups.google.com/groups?q=dsn+vs+dsn-less
> --
> -oj
> http://www.rac4sql.net
>
> "Vlad" <vovan.c@.verizon.net> wrote in message
> news:O5fGXDjAEHA.2180@.TK2MSFTNGP09.phx.gbl...
the
> Server
learn
somebody
DSN
>
DSN madness
password are contained in the app, and passed to the data source at run
time.
Everything works fine if the user is an Adminstrator (on Windows), but can't
connect if the user is a User or Power User. If I promote the user to
Administrator, it works; if I demote him back again, it doesn't.
The really strange thing is, this used to work just fine!
This is driving me nuts. Anyone have a solution?Paul Pedersen (nospam@.no.spam) writes:
> I have an app that accesses a SQL db via a DSN (and MSDE). The user name
> and password are contained in the app, and passed to the data source at
> run time.
> Everything works fine if the user is an Adminstrator (on Windows), but
> can't connect if the user is a User or Power User. If I promote the user
> to Administrator, it works; if I demote him back again, it doesn't.
> The really strange thing is, this used to work just fine!
> This is driving me nuts. Anyone have a solution?
And the error message is?
From what you say it sounds like a permission problem on the DSN.
(Disclaimed: I never liked or understood DSN. I prefer to live in a
DSN-less world.)
By the way... I don't know what sort of app this is, but embedding
username/password into the app, does not sound like something I would
do. Would it not be better to use Windows authentication?
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.se> wrote in message
news:Xns9798CEF77432EYazorman@.127.0.0.1...
> Paul Pedersen (nospam@.no.spam) writes:
> And the error message is?
Something on the order of "Database does not exist or access denied".
Like I said, this used to work fine. After a few w
slow. Then it began to have occasional errors signing in. Now it won't sign
in at all. Bizarre.
I have reinstalled and re-configured MSDE several times. Recreated the DSN
too. Works fine for Adminstrators, doesn't work at all for others. Perhaps I
made a mistake in configuration, but I can't think what it might be.
> From what you say it sounds like a permission problem on the DSN.
> (Disclaimed: I never liked or understood DSN. I prefer to live in a
> DSN-less world.)
> By the way... I don't know what sort of app this is, but embedding
> username/password into the app, does not sound like something I would
> do. Would it not be better to use Windows authentication?
The user name that is passed is assigned a specific role in the database.
Although there's only one instance of the app at present, eventually it
could be run by a number of users from a number of different machines. I
prefer not to have to track all those users, who have no other business in
the database anyway. This way, I can just track the app. Wherever it's
running from, it can sign in and get its data.
At present, the database is local to the machine the app is running on.
Within a couple w
> Something on the order of "Database does not exist or access denied".
> Like I said, this used to work fine. After a few w
> slow. Then it began to have occasional errors signing in. Now it won't
> sign in at all. Bizarre.
Since it goes slower and slower, it sounds like a networking problem.
What is the contents of the DSN?
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.se> wrote in message
news:Xns9799687B2B9DYazorman@.127.0.0.1...
> Paul Pedersen (nospam@.no.spam) writes:
> Since it goes slower and slower, it sounds like a networking problem.
I don't see what that might be. 1, It's not currently running on a network.
It's all local. 2, It works fine for Adminstrators, or even the account in
question if I promote it to Administrator (which I have done, just to get it
running - it's mission critical - but of course I don't want to leave it
that way). 3, Not everything was getting slow, just first getting access to
the data. Queries ran well enough.
> What is the contents of the DSN?
Nothing special. Created in the ODBC Control Panel as a System DSN. Set as
SQL Server authentication (user name & password) rather than Windows login.
User name and password are not saved (they are provided by the app). Default
database setting is ignored, because that's specified in the db for the app
user. Basically it has nothing but a name, which the app looks for, a
specification of the SQL Server driver, and the instance name of MSDE (I use
a named instance).
At present, there is no other access to that MSDE instance, which is the
only SQL Server instance on the machine.
It works fine, for Administrators. And it used to work for Limited Users,
too.|||Hey Paul,
It could be something obvious, like you set up a User DSN instead of a
System DSN; in that case, only the original user and/or the
Administrator group would have access to that DSN entry. Or, it could
be that the accounts don't have access to the Windows registry entry
required to load the System DSN information.
Take a look at :http://support.microsoft.com/kb/306345/EN-US
and see if it helps.
Stu|||Paul Pedersen (nospam@.no.spam) writes:
> "Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
> news:Xns9799687B2B9DYazorman@.127.0.0.1...
> I don't see what that might be. 1, It's not currently running on a
> network. It's all local. 2, It works fine for Adminstrators, or even the
> account in question if I promote it to Administrator (which I have done,
> just to get it running - it's mission critical - but of course I don't
> want to leave it that way). 3, Not everything was getting slow, just
> first getting access to the data. Queries ran well enough.
I've seen issues like this on a local machine. It that case I was logged
as admin, the problem is that shared memory freaked out.
I guess that this machine is in a domain, and not a solitary workstation?
Then there may be contacts with the domain controller. (Windows networking
is nothing I know well, so exactly what problems that may be, I don't know.)
> Nothing special. Created in the ODBC Control Panel as a System DSN. Set
> as SQL Server authentication (user name & password) rather than Windows
> login. User name and password are not saved (they are provided by the
> app). Default database setting is ignored, because that's specified in
> the db for the app user. Basically it has nothing but a name, which the
> app looks for, a specification of the SQL Server driver, and the
> instance name of MSDE (I use a named instance).
I had hoper that you have posted it as is.
What I wanted to know is whether you specify any network library.
In any case, verify in the Client Network Utiility that shared memory
is enabled. Although I mentioned that I've had problems with shared
memory, shared memory is what works best on a local computer.
Oh, since this is an MSDE machine, the Client Network Utility is probably
not available from the start menu, but running "CLICONFG" from command-
line should bring you to the version that comes with the MDAC.
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|||"Stu" <stuart.ainsworth@.gmail.com> wrote in message
news:1143942800.875293.89510@.j33g2000cwa.googlegroups.com...
> Hey Paul,
> It could be something obvious, like you set up a User DSN instead of a
> System DSN; in that case, only the original user and/or the
> Administrator group would have access to that DSN entry.
No, it was a system DSN. But thanks for trying.
> Or, it could
> be that the accounts don't have access to the Windows registry entry
> required to load the System DSN information.
> Take a look at :http://support.microsoft.com/kb/306345/EN-US
Hmm, that sounds interesting. I don't understand how that could have
happened, because it used to work.
I'll take a look at it.|||"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns97998597D1CA0Yazorman@.127.0.0.1...
> Paul Pedersen (nospam@.no.spam) writes:
> I've seen issues like this on a local machine. It that case I was logged
> as admin, the problem is that shared memory freaked out.
> I guess that this machine is in a domain, and not a solitary workstation?
> Then there may be contacts with the domain controller. (Windows networking
> is nothing I know well, so exactly what problems that may be, I don't
> know.)
It was in a domain, but the server's motherboard died, so I moved the
database from MSDE on the server to the local machine, and set up MSDE on
it, and have been running it all locally. That machine no longer has any
network connection; it's completely standalone now. Like I said, it's been
working fine for a while.
I should have a new server up within a couple w
so it gets lower priority), this time with actual SQL Server instead of
MSDE, so maybe I can get it working again since I'll have the Enterprise
Manager to play with.
>
> I had hoper that you have posted it as is.
How would I do that? As far as I know, the ODBC control panel has control
over that. I don't even know where the control panel stores its DSNs - I
just assumed in the registry somewhere. It's a system DSN, not a file DSN.
> What I wanted to know is whether you specify any network library.
There's nothing unusual in the way I set it up. I just chose SQL Server
driver, gave it the expected name, typed in the instance name of the server
(for some reason, it doesn't show up in the list), set it for SQL Server
authentication, and left everything else at the default.
> In any case, verify in the Client Network Utiility that shared memory
> is enabled. Although I mentioned that I've had problems with shared
> memory, shared memory is what works best on a local computer.
> Oh, since this is an MSDE machine, the Client Network Utility is probably
> not available from the start menu, but running "CLICONFG" from command-
> line should bring you to the version that comes with the MDAC.
Thanks. I would never have found it without that tip.
OK, I'll check that.
Thanks for all your help.sql
DSN less connection fro ASP pages
My web server is having windows NT having all asp pages.
I want to connect to SQL Server 2000 using a DSN less
connection for my asp pages. Could anyone help me with
that?
Also, if I try to create system DSN on windows NT, it
gives me an error message and does not create DSN. What
could be the reason?
ThanksThe syntax depends on whether you are using OLE DB or ODBC,
it you are connecting using a standard SQL login or Windows
Authentication, etc. You can find sample ADO connection
strings which cover different scenarios at:
http://www.able-consulting.com/ADO_Conn.htm
The problem creating the DSN would depend on what the error
message is that you are receiving - it's hard to say without
more information about the error.
-Sue
On Wed, 25 Feb 2004 13:43:59 -0800, "namita"
<anonymous@.discussions.microsoft.com> wrote:
>I have installed Microsoft SQL server 2000 on a server.
>My web server is having windows NT having all asp pages.
>I want to connect to SQL Server 2000 using a DSN less
>connection for my asp pages. Could anyone help me with
>that?
>Also, if I try to create system DSN on windows NT, it
>gives me an error message and does not create DSN. What
>could be the reason?
>Thanks|||Hello,
<%
set conn1=server.CreateObject("adodb.connection")
conn1.cursorlocation=3
conn1.Open "Provider=sqloledb;" & _
"Data Source=Server;" & _
"Initial Catalog=DB;" & _
"User Id=ayaz;" & _
"Password=ayaz"
%>
and also
try this one too.
conn1.open " dsn=ayaz;uid=ayaz;pwd=ayaz;DATABASE=ayaz
;APP=ASP Script"
i hope its will help you , if any problem then email me.
Thanks,
Warm Regards,
Ayaz Ahmed
Software Engineer & Web Developer
Creative Chaos (Pvt.) Ltd.
"Managing Your Digital Risk"
http://www.csquareonline.com
Karachi, Pakistan
Mobile +92 300 2280950
Office +92 21 455 2414
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
DSN issue/question..
I have 2 instances of SQL on the same box. I am running Great Plains on both. When I change the properties of one system DSN, it automatically updates the other entry also. Have any of you seen this before? Any insights would help.
Thanks
Sundar
You are in the wrong forum.Try this for starters: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=93&SiteID=1|||following Phil's suggestion, thread moved to DB Engine forum
dsn help
DSN Name : work
Database Name data\work.mdb
Type Access
the code i wrote is this
conClsf = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=data\\me.work" & server.mappath("data\\work.mdb") & ";")
i don't know what to soFor data source, provide the physical path to the data source only. Or if using DSN, you just use the "dsn=<name>" text, I believe. Is this ASP.NET 2.0 code?
Brian
DSN goes to wrong database
I set up a system DSN but it connects to the wrong database. I have set the default database correctly but it seems to ignore it.
If i switch to the correct BD like this: "USE myDB SELECT * FROM myTable" then it works fine.
Am i missing something?
this is my connection string [in my ASP page]:
"Driver={SQL Server};" &_
"Server=myServer;" &_
"DSN=myDSN;" &_
"UID=myUserName;" &_
"PWD=myPWD;"
Thanks!What database is it defaulting to ?|||Looks like you're mixing up the ODBC connect string data. Use one of these formats
To use the System DSN you created use
"Driver={SQL Server};" &_
"DSN=myDSN;" &_
"UID=myUserName;" &_
"PWD=myPWD;"
(may or maynot work)
To use a DSNless connection use
"Driver={SQL Server};" &_
"Database=myDB;" &_
"UID=myUserName;" &_
"PWD=myPWD;"
(Should work, but haven't tested)
I'm thinking it's probably trying to use the user's default database set up in SQL Server. Your alternative would be to go into use manager and change the default db (or tell your DBA to do it).
Originally posted by rnealejr
What database is it defaulting to ?|||yeah i think it has something to do with the particular user. a different username and password will change the default database.
i'll try that connection string. thank you!
the problem is i am the DBA at the moment. the ususal guy is away for awhile.
DSN connection w/o password
i want to connect to SQL Server using DSN.
I create a System DSN, say 'DSN_PWD', provide SQL server authentication in that step and test the connection which works fine.
Now, currently i am using a code by my seniors which is as below
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DSN_PWD","username","password"
objConn.Close
Set objConn =Nothing
what i am concerned is that this will be saved as ASP file, i don't want any login informatoin to be saved in a physical file openly.
i have tried this but it gives error
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DSN=DSN_PWD;"
objConn.Open
objConn.Close
Set objConn =Nothing
Error
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
is there any effective way?
Thanks all
Yogesh JangamYou can hardcode the username and the password within the DSN itself using the ODBC Connection Manager. Is that what you want?
-PatP|||my primary concern being security, i don't want any SQL login information to be saved in any ASP files.
I am creating DSN with SQL Authentication with Login ID/PWD entered by user
i want a method to use this DSN to create an ADODB.Connection w/o manually again typing username and password in objConn.open method
i hope i am clear ;-).......
i have looked for connection code, but most of them have login info in the Open method.
Thanks
Yogesh Jangam|||The easiest way to do this is if your IIS service runs as an NT account. Then just use Windows Authentication for your ODBC connection and you are "good to go" without any fuss at all.
If you must run your IIS Service as LocalSystem, then you need to butcher a DSN to force static SQL authentication. That would be a last resort.
-PatPsql
DSN Connection to SQL Server
lngResult = SQLConfigDataSource(0, _
ODBC_ADD_SYS_DSN, _
"SQL Server", _
"DSN=" & JDS_DSN_name & Chr(0) & _
"Server=" & JDS_Server_name & Chr(0) & _
"Database=RMAData" & Chr(0) & _
"UseProcForPrepare=Yes" & Chr(0) & _
"Description=RMA Database" & Chr(0) & Chr(0))Figured it out|||Try specifying "Trusted_Connection=No" attribute along with the other attributes specified in SQLConfigDataSource().
DSN Connection to Remote SQL Server
Hi,
I've worked with SQL Server plenty but never in this specific manner. Hoping someone can shed some light.
I have a webform on web server A that needs to talk to a SQL server database that web server B accesses via its web application. I do not haveany privelidged access to server B or the sql server it uses (no FTP to webserver, no remote access via Enterprise Manager to the SQL server). The Admin of Server B told me that I can use a DSN connection to talk to the SQL server database that the web app on server B uses. He emailed me the names of the SQL database tables AND a copy of the web.config from server B which shows the DSN implemented like this:
<appSettings>
<add key="dsn" value="data source=sql3.domainname.net;database=dbname;User Id=dbuserid;password=dbpw;" />
<add key="default_language" value="en" />
<add key="error_email_to" value="someone@.domainname.com" />
<add key="baseHref" value="http://www.mysite.com/" />
<add key="website_name" value="$$$$$$$$$$$$$$$$$" />
</appSettings>
I was planning to run my webforms on Server A where I do have FTP, Control Panel, etc.
So, I wrote this code into my VB.NET codebehind file.
Dim oODBCConnectionAs OdbcConnection
Dim sConnStringAsString = _
"Driver={SQL Server};" & _
"Server=sql3.domainname.net;" & _
"Database=dbname;" & _
"Uid=dbuserid;" & _
"Pwd=dbpw"
oODBCConnection =New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()
... commands to access data and load something into a control on a webform
oODBCConnection.Close()
When I attempt to run the webform in my browser from Server A. I'm getting this error:
ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()).
The error is EXACTLY the same whether I place the appSettings section in server A's web.config or leave them out.
I have obvious questions about the error like...
Might sql3.domainname.net simply be refusing communication requests that don't come from the Server B domain?
Might the sql3.domainname.net be setup so that I need to use another protocol (not tcp/ip)?
Might my code need to be changed to support this type of connection (i.e. I didn't code it right)?
I spent some time readinghttp://support.microsoft.com/kb/328306/en-us but I'm at a loss as to what the best course is to take for debugging this.
Thanks in advance for any insight you can offer.
Stewart
Hi,
I think you should get the remote server's ip address and user account to creat a local DSN and call the DSN in your application. Another easy solution is to use SqlConnection rather then ODBCConnection and modify your connection string and make it look like "DataSource=IP address;Initial Catelog=DBName;User Id=;Password="
Thanks.