Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Programming
»
Connecting
»
Website can't connect. 500 error
Website can't connect. 500 error
Rate Topic
Display Mode
Topic Options
Author
Message
54.69.6d.20
54.69.6d.20
Posted Monday, October 08, 2012 7:35 AM
Grasshopper
Group: General Forum Members
Last Login: Monday, October 15, 2012 8:16 AM
Points: 16,
Visits: 20
For a better understanding. Everything was on "oldserver" (DC, exchange, sql2008, website, etc). I moved Exchange, DC and website to a new server (server1) and moved sql 2008 to a new server (server2)
Part of my website (on server1) connects to the sql2008 server (server2) for information. In the code below it appears that it doesn't need a DSN connection to access server2. After the DB move from 2003 server to 2008 server, it's not working. I've added the new information, but for some reason it's not connecting.
Since I moved the DB to 2003 to a 2008 server. Do I need to change anything in SQL?
The website is on a new 2011 server. Do I need to do something in IIS?
Is the code incorrect? I've been checking on a few sites and it looks correct.
The reason its setup this way is because for some reason I can't setup a DSN connection between server1 and server2. I get an error every time I set it up. However, I have about 14 pcs connected to server2 through a DSN connection.
Thanks for the help
Dim Conn
Dim MyRS
Dim MyRes
Dim TheLEN
Dim TheLink
Dim TheAddr
Dim MyOrderBy
if request.form("SortSelection") = "" then
MyOrderBy = "ACRProcedures.[Documentation Title]"
elseif request.form("SortSelection") = "Document Tittle" then
MyOrderBy = "ACRProcedures.[Documentation Title]"
elseif request.form("SortSelection") = "Doc Status" then
MyOrderBy = "ACRProcedures.ManufacturersEquipmentManual"
elseif request.form("SortSelection") = "Rev Level" then
MyOrderBy = "ACRProcedures.RevNumber"
elseif request.form("SortSelection") = "Procedure#" then
MyOrderBy = "ACRProcedures.[ACR Procedure]"
elseif request.form("SortSelection") = "Last Review" then
MyOrderBy = "ACRProcedures.LastReviewed"
elseif request.form("SortSelection") = "Audit Date" then
MyOrderBy = "ACRProcedures.NextAudit"
end if
set conn = server.createobject("ADODB.connection")
conn.mode = admoderead
conn.connectionstring ="provider=SQLOLEDB;DATA SOURCE=server2\angelsdatabase;INITIAL CATALOG=ACR;UID=Webuser;PWD=TestPass123"
conn.open
set myrs = server.createobject("ADODB.recordset")
set myrs = conn.execute("SELECT * FROM ACRProcedures ORDER BY "& MyOrderBy)
if not(myrs.eof) then
myrs.movefirst
else
response.write "Error... Please try again later."
end if
while not(myrs.eof)
thelen = instr(myrs("Weblink"),"#")
if (thelen < 2) or isnull(myrs("Weblink")) then
thelink = "NA"
theaddr = "-"
thelen = 2
else
thelink = left(myrs("WebLink"),(thelen) - 1)
theaddr = "<a href=" & chr(34) & "http://" & thelink & chr(34) & ">" & thelink & "</a>"
end if
response.write "<tr><td align=""left"" width=""30%"">"
response.write myrs("Documentation Title") & "</td><td align=""left"" width=""20%"">"
response.write "-" & myrs("ManufacturersEquipmentManual") & "</td><td align=""left"" width=""20%"">"
response.write myrs("ACR Procedure") & "</td><td align=""center"" width=""30%"">"
response.write theaddr & "</td><td>" & myrs("RevNumber") & "</td>"
response.Write "<td align=""center"" width=""30%"">" & myrs("NextAudit") & "</td>"
response.Write "<td align=""center"" width=""30%"">" & myrs("LastReviewed") & "</td></tr>"
myrs.movenext
wend
response.write "</table>"
myrs.close
conn.close
set conn = nothing
%>
<p align="center"> </p>
<p align="center"><font size="1">Master Documentation List; Rev 6</font></p>
</body>
Post #1369811
Sean Lange
Sean Lange
Posted Monday, October 08, 2012 7:45 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Yesterday @ 3:32 PM
Points: 8,980,
Visits: 8,540
The code looks ok. It is impossible for us to know if it is correct though. You need to figure out what the error is. This can be somewhat painful in IIS7. You need to open the ASP feature. Then Debugging Properties -> and change the setting of Send Errors To Browser to True. Then you need to browse the site from the server. It should now display error message in the browser (assuming you have turned off friendly error messages in your browser) like IIS6 and earlier.
You may have to go to your code and add the following if you still have issues.
response.write 'made it'
response.end
Then you can move this code around to figure out what line is causing the error. Without knowing what the error is, it will be impossible to fix it and debugging classic asp is a PITA.
_______________________________________________________________
Need help? Help us help you.
Read the article at
http://www.sqlservercentral.com/articles/Best+Practices/61537/
for best practices on asking questions.
Need to split a string? Try Jeff Moden's
splitter
.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Post #1369817
54.69.6d.20
54.69.6d.20
Posted Monday, October 08, 2012 8:51 AM
Grasshopper
Group: General Forum Members
Last Login: Monday, October 15, 2012 8:16 AM
Points: 16,
Visits: 20
I'm getting:
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
/qam/MasterDocumentationList.asp, line 98
Which is pretty much the same error I'm getting when i was trying to make a DSN connection. So this doesn't make sense. Like I mentioned, i have 14 other pcs connected to server2. For what I understand, 64bit and 32bit machines should be able to talk. Server1 is the DC and it's trusted and can ping\connect to it.
Could it be a firewall issue? Last week had some issues with a few pcs connecting to server2. I figured out what another tech did... It didn't make since that's why I didn't check the firewall. However, he setup the connections to only public and not domain. Everyone and the servers are on a domain. I don't know what he was thinking...
LOL... Thanks for the help again. I figured i'd check that firewall again. I found by default is was to block everything on inbound connections (domain profile) in the windows firewall properties (of course unless specified). <<< Shaking head... trying to figure out what the other IT guy was doing with his time. Certainly knowing or learning how to setup servers!
Love this site.. My not get the answer, but gives me a chance to bounce ideas so I can find the right answer. PLUS.. people actually respond in a good amount of time :)
Post #1369866
Mark Eckeard
Mark Eckeard
Posted Monday, October 08, 2012 5:48 PM
SSC Journeyman
Group: General Forum Members
Last Login: Yesterday @ 5:56 AM
Points: 82,
Visits: 350
Author,
See if this article helps:
http://www.drdev.net/article10.asp
Mark
Post #1370117
Sean Lange
Sean Lange
Posted Tuesday, October 09, 2012 7:15 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Yesterday @ 3:32 PM
Points: 8,980,
Visits: 8,540
Oh holy cow of embarrassment....You are on a 64bit machine and trying to setup a DSN to a 32bit machine right? The DSN utility on a 64bit machine creates a 64bit DSN and you need the 32bit version.
The 32bit ODBC can be found at: %systemdrive%\Windows\SysWoW64\odbcad32.exe
You will notice when open this up that the DSNs you already created are not there. Let me know if that is the issue.
_______________________________________________________________
Need help? Help us help you.
Read the article at
http://www.sqlservercentral.com/articles/Best+Practices/61537/
for best practices on asking questions.
Need to split a string? Try Jeff Moden's
splitter
.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Post #1370379
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.