Re: Migrating ASP/MSSQL app from IIS 4 to IIS 6
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Thu, 10 Nov 2005 10:58:00 -0500
WebTent wrote:
> We have moved an Internet and Intranet site over to our IIS 6 MS Small
> Business Server 2003. The Internet site works fine, but was done by a
> company recently. The Intranet site is older and we're having
> problems from the get go. The first thing I've hit a problem with, I
> cannot seem to track down the cause. I have the following code:
>
> Set cnn=Server.CreateObject("ADODB.Connection")
> cnn.Open "EXECBOB","SA",""
1. Don't use your sa account for your applications. Create a
limited-permission account to use instead. Using sa can lead to bad habits.
sa should only be used for server administration. Nothing else. The
potential for misuse in the wrong hands is huge.
2. A blank password for the sa account?!? Have you never heard of Code
Red??? Hopefully you've just censored the password so you could post your
connection's Open statement.
3. Avoid using ODBC: http://www.aspfaq.com/show.asp?id=2126
> Set cmd = Server.CreateObject("ADODB.Command")
It's not fatal, but I don't see why you are using an explicit Command
object.
> cmd.ActiveConnection = cnn
> cmd.CommandType = 1
> Set rst = Server.CreateObject("ADODB.Recordset")
> cmd.CommandText = "SELECT * FROM Sendout_Records ORDER BY
Don't use selstar: http://www.aspfaq.com/show.asp?id=2096
> Arranged_Date DESC"
> rst.Open cmd, , 3, 1
Again, nothing fatal, but I don't see why you are using anything but the
default forward-only cursor. This code could be simplified to:
sSQL="SELECT <column list> FROM Sendout_Records " & _
"ORDER BY Arranged_Date DESC"
set rst=cnn.execute(sSQL,,1)
> companyID=rst(6)
> apptDate=rst(1)
> latestJO="Congratulations to "&recruiterName(rst(11))&" for posting
> the latest send out: "&PCase(rst(10))&" with "
> rst.Close
>
> That recordset is coming back empty, however, if I run the
> commandText in the MSSQL ent mgr directlry, brings up many records.
Use SQL Profiler to verify that the commad text you expect to be executed is
actually what is being exxecuted.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- Follow-Ups:
- Re: Migrating ASP/MSSQL app from IIS 4 to IIS 6
- From: WebTent
- Re: Migrating ASP/MSSQL app from IIS 4 to IIS 6
- From: WebTent
- Re: Migrating ASP/MSSQL app from IIS 4 to IIS 6
- Prev by Date: Re: how to match time ranges for multiple records in a query?
- Next by Date: How to do sum of columns without nested loops?
- Previous by thread: A Challenging Problem I'm Trying to Resolve ....
- Next by thread: Re: Migrating ASP/MSSQL app from IIS 4 to IIS 6
- Index(es):
Relevant Pages
|