Showing posts with label iis. Show all posts
Showing posts with label iis. Show all posts

Sunday, March 25, 2012

ASP to SQL Connection Prob, Same Server, IIS

Yes, it should be easy...

I have a single box hosing IIS and SQL Server 2000. In my ASP script I've
tried using the following connection strings to attempt to connect to no
avail:

"Provider=SQLOLEDB;Server=servername\instancename,1 433;Database=TEST;network=DBMSSOCN;uid=TEST;pwd=TE ST"
"Provider=SQLOLEDB;Server=local IP
address\instancename,1433;Database=TEST;network=DB MSSOCN;uid=TEST;pwd=TEST"

"Provider=SQLOLEDB;Server=external IP
address\servername\instancename;Database=TEST;netw ork=DBMSSOCN;uid=TEST;pwd=TEST"

Getting error:

"Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]Specified SQL server not found."

SQL Server is set up for SQL and Windows authentication. Server utility is
configured for both named pipes and TCP/IP. Port is set to 1433.

I can connect to the DB using Query Analyzer both from the local server
itself AND from a remote laptop over the internet.

So, what am I missing???

Thanks in advance,

ChadChad Richardson (chad@.NIXSPAM_chadrichardson.com) writes:
> SQL Server is set up for SQL and Windows authentication. Server utility is
> configured for both named pipes and TCP/IP. Port is set to 1433.

But you have a named instance. Yes, you can of course have a named
instance on port 1433, but normally this is where you have the unnamed
instance.

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

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||OK. But if you can have one, than do you have any other ideas on why it
would not connect?

I have this same set up on my development laptop and it connects fine,
except that my web site on the laptop is served up from a virtual directory.
On the home development box, the web site is located under the
InetPub\wwwroot folder. Not sure if this would change the "perspective" that
the connection call is coming from and hence would require a different
syntax...

"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns960E3D672D9AYazorman@.127.0.0.1...
> Chad Richardson (chad@.NIXSPAM_chadrichardson.com) writes:
>> SQL Server is set up for SQL and Windows authentication. Server utility
>> is
>> configured for both named pipes and TCP/IP. Port is set to 1433.
> But you have a named instance. Yes, you can of course have a named
> instance on port 1433, but normally this is where you have the unnamed
> instance.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp|||Chad Richardson (chad@.NIXSPAM_chadrichardson.com) writes:
> OK. But if you can have one, than do you have any other ideas on why it
> would not connect?

I asked my question mainly as incentive for you to double-check.

> I have this same set up on my development laptop and it connects fine,
> except that my web site on the laptop is served up from a virtual
> directory. On the home development box, the web site is located under
> the InetPub\wwwroot folder. Not sure if this would change the
> "perspective" that the connection call is coming from and hence would
> require a different syntax...

I don't really see why either. Then again, I'm completely ignorant about
IIS.

But there is one thing I don't like in your connection string:
network=DBMSSOCN. I believe this library is out-dated. Not that I
think it matters, but remove it.

And, hm, what about removing 1433? After all there is a service to
find the port. And then there is shared memory which does not even need a
port...

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

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

Thursday, March 22, 2012

ASP Impersonation - null user

Hi, this could be an ASP, IIS or SQL server question so please bear with me!
We have an sql server 2000 machine and our IIS 6 machine running seperately
but on the same domain. I can connect fine to the database without using
impersonation, but when it's enabled I get the error:
"Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection."
I've tried looking into this, and noted suggestions of copying accounts to
the database server machine.. is this really necessary? they're on the same
domain, and that would be lots of hassle as I'm hoping to allow anyone on
the domain access to the pages, with authorisation being ran against the sql
server roles/security groups.
Hope my query makes sense.. for info when I check
System.Security.Principal.WindowsIdentity.GetCurrent().Name I get the
expected result.
cheers for any help,
ChrisNot Me
Was your SQL Server set up with Windows Authentication only?
"Not Me" <Not.Me@.nada.nope.hk.za> wrote in message
news:1166521469.754869@.ucsnew2.ncl.ac.uk...
> Hi, this could be an ASP, IIS or SQL server question so please bear with
> me!
> We have an sql server 2000 machine and our IIS 6 machine running
> seperately but on the same domain. I can connect fine to the database
> without using impersonation, but when it's enabled I get the error:
> "Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection."
> I've tried looking into this, and noted suggestions of copying accounts to
> the database server machine.. is this really necessary? they're on the
> same domain, and that would be lots of hassle as I'm hoping to allow
> anyone on the domain access to the pages, with authorisation being ran
> against the sql server roles/security groups.
> Hope my query makes sense.. for info when I check
> System.Security.Principal.WindowsIdentity.GetCurrent().Name I get the
> expected result.
> cheers for any help,
> Chris
>|||"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%237eitB2IHHA.1280@.TK2MSFTNGP04.phx.gbl...
> "Not Me" <Not.Me@.nada.nope.hk.za> wrote in message
> news:1166521469.754869@.ucsnew2.ncl.ac.uk...
[vbcol=seagreen]
> Was your SQL Server set up with Windows Authentication only?
Aha, I'll check with the admin... was just reading up on how mixed-mode is
required in some circumstances, is this what you're getting at?
cheers,
Chris|||Yes. you can changed it and re-connict again
"Not Me" <Not.Me@.nada.nope.hk.za> wrote in message
news:1166527936.903888@.ucsnew2.ncl.ac.uk...
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:%237eitB2IHHA.1280@.TK2MSFTNGP04.phx.gbl...
>
> Aha, I'll check with the admin... was just reading up on how mixed-mode is
> required in some circumstances, is this what you're getting at?
> cheers,
> Chris
>
>|||Hmmm, it is already in mixed-mode.
Any other ideas?
cheers,
Chris
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:e1vPDJ2IHHA.4712@.TK2MSFTNGP04.phx.gbl...
> Yes. you can changed it and re-connict again
>
> "Not Me" <Not.Me@.nada.nope.hk.za> wrote in message
> news:1166527936.903888@.ucsnew2.ncl.ac.uk...
>|||http://support.microsoft.com/?kbid=555017
http://www.microsoft.com/technet/pr...ds/default.mspx
"Not Me" <Not.Me@.nada.nope.hk.za> wrote in message
news:1166532551.477926@.ucsnew2.ncl.ac.uk...
> Hmmm, it is already in mixed-mode.
> Any other ideas?
> cheers,
> Chris
>
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:e1vPDJ2IHHA.4712@.TK2MSFTNGP04.phx.gbl...
>|||"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eyAiGA3IHHA.3268@.TK2MSFTNGP04.phx.gbl...
> http://support.microsoft.com/?kbid=555017
Is that really necessary? it mentions non-domain web environments? all
servers are on the same domain. Seems lengthy for what I imagine to be a
very simple task.
[vbcol=seagreen]
> http://www.microsoft.com/technet/pr...ds/default.mspx[/vbco
l]
A tad more direction would help, there's hundreds of downloads! (it does
have the latest service pack)
cheers,
Chris

Tuesday, March 20, 2012

ASP + SQL loads really slow over intranet

Hi guys,

I've created a web application using ASP together with SQL Server as
our db source, running through IIS 6 on a Winows Server 2003 platform.

This application retrieves a list of customer codes from our db, so
records returned could be as many as 2000+ for any single transaction.

The application runs fine for users from the same state. However, our
interstate colleagues have notice that it takes more than 3-4mins for
the page to load, while it only takes me < 2secs to load.

Our intranet server is located in the same state as I, so anyone from
within this state has no problems loading the page. All other states
are finding it unbearable.

I've done some debugging, and it appears to be a server factor.
I saved the page with the longest list to a local drive and opened it
locally in IE and it loads quickly.

Does anyone have any suggestions as to how to speed this application up
for our interstate users?
Any ideas would appreciated.

Thanks,
ShawnI would start by trying to identify the bottleneck - from what you've
said, it's not clear if this is an MSSQL issue. If I understand you,
both you and the other users are hitting the same IIS server, and
issuing the same queries, but they get the results slowly and you
don't. That could suggest that the delay is in serving the pages to the
remote users, not in retrieving the data from the database.

You can use the MSSQL Profiler to check the duration and execution plan
of your queries, to see if there's any difference depending on the user
requesting the data. If there is a difference, then hopefully the
execution plan will give you a clue as to where the problem is.

You might also want to post in an ASP/IIS group, if you haven't already
done so - many performance problems aren't due to only one issue, so
getting some ideas about how to investigate the other components of the
system would probably be useful.

Simon|||Hi Simon,

I did some debugging, and it took SQL Server the same about of time to
do complete the query for both local and interstate, and it's the
serving of the page that is definitely taking much longer on our
interstate servers.

Usually, most users would do a query that should return about 1000+
records, and than these records gets displayed into a table on the asp
page. The page (file size) itself is roughly around 110+kB, so it's not
exactly a BIG file to be tranferred. But then why the slow down?

Any advices/ideas on how to by-pass this problem?

Regards,
Shawn

Simon Hayes wrote:
> I would start by trying to identify the bottleneck - from what you've
> said, it's not clear if this is an MSSQL issue. If I understand you,
> both you and the other users are hitting the same IIS server, and
> issuing the same queries, but they get the results slowly and you
> don't. That could suggest that the delay is in serving the pages to
the
> remote users, not in retrieving the data from the database.
> You can use the MSSQL Profiler to check the duration and execution
plan
> of your queries, to see if there's any difference depending on the
user
> requesting the data. If there is a difference, then hopefully the
> execution plan will give you a clue as to where the problem is.
> You might also want to post in an ASP/IIS group, if you haven't
already
> done so - many performance problems aren't due to only one issue, so
> getting some ideas about how to investigate the other components of
the
> system would probably be useful.
> Simon|||"Shawn H" <ShawnStyler@.gmail.com> wrote in message
news:1112975388.441101.9010@.z14g2000cwz.googlegrou ps.com...
> Hi Simon,
> I did some debugging, and it took SQL Server the same about of time to
> do complete the query for both local and interstate, and it's the
> serving of the page that is definitely taking much longer on our
> interstate servers.
> Usually, most users would do a query that should return about 1000+
> records, and than these records gets displayed into a table on the asp
> page. The page (file size) itself is roughly around 110+kB, so it's not
> exactly a BIG file to be tranferred. But then why the slow down?
> Any advices/ideas on how to by-pass this problem?
> Regards,
> Shawn

<snip
No idea, unfortunately. Since the problem seems to be serving the pages,
you'll probably get better assistance in an IIS/ASP group.

Simon

ASP + SQL Loads Really Slow Over Intranet

Hi guys,
I've created a web application using ASP together with SQL Server as
our db source, running through IIS 6 on a Winows Server 2003 platform.
This application retrieves a list of customer codes from our db, so
records returned could be as many as 2000+ for any single transaction.
The application runs fine for users from the same state. However, our
interstate colleagues have notice that it takes more than 3-4mins for
the page to load, while it only takes me < 2secs to load.
Our intranet server is located in the same state as I, so anyone from
within this state has no problems loading the page. All other states
are finding it unbearable.
I've done some debugging, and it appears to be a server factor.
I saved the page with the longest list to a local drive and opened it
locally in IE and it loads quickly.
Does anyone have any suggestions as to how to speed this application up
for our interstate users?
Any ideas would appreciated.
Thanks,
ShawnHi
Returning 2000+ customer codes and putting it into a dropdown will make any
application unbearable. How do you find what you are looking for with a drop
down like that?
How are you retrieving the codes, a select * from ...or a select CustomerID
from ...?
Make sure you are not doing any data binding.
If the application is fast in the local state, it means that SQL Server does
all it's work in under 2 seconds, no matter what state, and then pushing the
resultant web page over the wire is your performance bottleneck. How big is
the resultant page? Anything more than 100Kb is generally considered bad.
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/
"Shawn H" <ShawnStyler@.gmail.com> wrote in message
news:1112934431.434915.93490@.o13g2000cwo.googlegroups.com...
> Hi guys,
>
> I've created a web application using ASP together with SQL Server as
> our db source, running through IIS 6 on a Winows Server 2003 platform.
>
> This application retrieves a list of customer codes from our db, so
> records returned could be as many as 2000+ for any single transaction.
>
> The application runs fine for users from the same state. However, our
> interstate colleagues have notice that it takes more than 3-4mins for
> the page to load, while it only takes me < 2secs to load.
>
> Our intranet server is located in the same state as I, so anyone from
> within this state has no problems loading the page. All other states
> are finding it unbearable.
>
> I've done some debugging, and it appears to be a server factor.
> I saved the page with the longest list to a local drive and opened it
> locally in IE and it loads quickly.
>
> Does anyone have any suggestions as to how to speed this application up
> for our interstate users?
> Any ideas would appreciated.
>
> Thanks,
> Shawn
>|||Hi Mike,
I'm not sure where you got the idea that I'm putting all the records
into a drop-down list, coz all I'm doing is just puting it into a
table.
I forgot to mention that to retrieve the records, I call a stored
procedure that does this:
"select fldCustCode, fldCustName (etc..)
from tbCust
where fldCustCode = @.custcode"
I think you might be right about the bottleneck being it has to send
the page back over the network.
I did a quick check, and the file size is just a little over 110+kB.
Is there anyway I can get around this?
Somehow I can reduce/compress the file size while it gets sent over the
network? (if thats even possible)
Regards,
Shawn
Mike Epprecht (SQL MVP) wrote:
> Hi
> Returning 2000+ customer codes and putting it into a dropdown will
make any
> application unbearable. How do you find what you are looking for with
a drop
> down like that?
> How are you retrieving the codes, a select * from ...or a select
CustomerID
> from ...?
> Make sure you are not doing any data binding.
> If the application is fast in the local state, it means that SQL
Server does
> all it's work in under 2 seconds, no matter what state, and then
pushing the
> resultant web page over the wire is your performance bottleneck. How
big is
> the resultant page? Anything more than 100Kb is generally considered
bad.
> 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/
> "Shawn H" <ShawnStyler@.gmail.com> wrote in message
> news:1112934431.434915.93490@.o13g2000cwo.googlegroups.com...
as
platform.
transaction.
our
for
from
states
it
application up|||Shawn wrote on 7 Apr 2005 23:56:13 -0700:

> Hi Mike,
> I'm not sure where you got the idea that I'm putting all the records
> into a drop-down list, coz all I'm doing is just puting it into a
> table.
> I forgot to mention that to retrieve the records, I call a stored
> procedure that does this:
> "select fldCustCode, fldCustName (etc..)
> from tbCust
> where fldCustCode = @.custcode"
> I think you might be right about the bottleneck being it has to send
> the page back over the network.
> I did a quick check, and the file size is just a little over 110+kB.
Large tables are really noticeable when the bottleneck is the connection -
until the end table tag is received IE won't show anything. If you remove
the table tags for testing and just show plain text, you'll probably find
those users start seeing data almost immediately. Still, 110kB isn't much -
are you sure it's not 1.1MB? I've got a table displayed in my browser right
now with only a menu system, 6 columns (and mostly numbers in each of
those), and for around 100 rows that's 160kB. This page shows up on my home
PC in around 4-5 secs over a 512kbps ADSL line. I guess if your users have
dialup then it might take a few mins, but anything faster shouldn't.

> Is there anyway I can get around this?
> Somehow I can reduce/compress the file size while it gets sent over the
> network? (if thats even possible)
If you don't need all the data to be seen at once is to use paging - show
say 100 per page, with clickable page numbers to get other records.
If the data doesn't need to look nice you could look at pre tags and fixed
width spacing of lines.
If both ends support gzip compression then it's possible I guess.
Dan|||Hi Daniel,
The file is definitely 110+kB and not 1.1Mb, I wouldn't miss such a big
difference.
The asp page itself is pretty simple, it doesn't contain any menu(s) or
any images, it only contains two buttons and a table consisting of 8
columns and over 1000+ rows (each with some short text and small
numbers).
I still gotta find out how fast our interstate connections are, but
it's definitely not dial-up.
I'll keep trying ... but keep the suggestions coming!
Regards,
Shawn
Daniel Crichton wrote:
> Shawn wrote on 7 Apr 2005 23:56:13 -0700:
>
records
send
110+kB.
> Large tables are really noticeable when the bottleneck is the
connection -
> until the end table tag is received IE won't show anything. If you
remove
> the table tags for testing and just show plain text, you'll probably
find
> those users start seeing data almost immediately. Still, 110kB isn't
much -
> are you sure it's not 1.1MB? I've got a table displayed in my browser
right
> now with only a menu system, 6 columns (and mostly numbers in each of

> those), and for around 100 rows that's 160kB. This page shows up on
my home
> PC in around 4-5 secs over a 512kbps ADSL line. I guess if your users
have
> dialup then it might take a few mins, but anything faster shouldn't.
>
the
>
> If you don't need all the data to be seen at once is to use paging -
show
> say 100 per page, with clickable page numbers to get other records.
> If the data doesn't need to look nice you could look at pre tags and
fixed
> width spacing of lines.
> If both ends support gzip compression then it's possible I guess.
> Dan|||Shawn wrote on 8 Apr 2005 09:00:24 -0700:

> The file is definitely 110+kB and not 1.1Mb, I wouldn't miss such a big
> difference.
> The asp page itself is pretty simple, it doesn't contain any menu(s) or
> any images, it only contains two buttons and a table consisting of 8
> columns and over 1000+ rows (each with some short text and small
> numbers).
OK, I was just wondering as my HTML is quite large (I guess due to using
links and having a number of columns with around 50 characters each per
row). A basic table with 1000 rows, 8 columns, and 1 character per column is
around 90kB.

> I still gotta find out how fast our interstate connections are, but
> it's definitely not dial-up.
> I'll keep trying ... but keep the suggestions coming!
As your earlier posts state that the page comes up immediately for yourself
for the same data, then the bottleneck has to be something that's between
the other states and your server that your PC doesn't go through. Could be a
router or firewall somewhere in the path that's overloaded and is passing
data really slowly. Have you tried a traceroute from some of these locations
to your server to see what the response times are like from each router in
the path?
Dan|||some other things you might want to take a look at a well...
How often is the clients cache cleared?
Stylesheets...how big are the stylesheets being used?
Scripts .... are they set to "DEFER" correctly?
Message posted via http://www.webservertalk.com