Results 1 to 3 of 3

Thread: Ugh!!!!

  1. #1
    NewASPer Guest

    Default Ugh!!!!

    I can pin point the problem area but have gotten it to work once but now it will not. It says that the operation is not allowed when the object it closed. Any and all advise is appreciated.<BR><BR><BR>set acn = server.CreateObject("ADODB.Connection")<BR> acn.Open application("dbconn")<BR> set rcd = server.CreateObject("ADODB.Recordset")<BR> strSql = "Select * from SkyWeb_Contacts WHERE DepartmentID = " & varDeptID & " Order By Name" <BR> set rcd.ActiveConnection = acn<BR> The problem is here, anybody know how I may fix it? <BR> rcd.Open sqlstr<BR>Thanks in advance.<BR>Rob<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Ugh!!!!

    One problem I can see right away is that you are using the variable "strsql" for generating the sql query but when you are opening the recordset you are using "sqlstr".<BR><BR>Change this and try again...<BR><BR>Sandy

  3. #3
    KPW Guest

    Default Using Option Explicit?

    Are you using Option Explicit? You should always use Option Explicit, because it forces you to declare your variables. Any undeclared variables will throw an error.<BR><BR>Just put<BR><BR>&#060;% Option Explicit %&#062;<BR><BR>at the top of your ASP page. Then use Dim to declare your variables, as in<BR><BR>Dim strSql<BR><BR>Anyhoo, if it is a conflict between variable names, the ASP engine would have caught your mistake right off the bat if you had used Option Explicit.<BR><BR>(If you did use Option Explicit, then ignore this.)<BR><BR>HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts