October 8, 2012 at 7:35 am
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>
October 8, 2012 at 7:45 am
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 Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
October 8, 2012 at 8:51 am
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 🙂
October 8, 2012 at 5:48 pm
October 9, 2012 at 7:15 am
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 Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply