Select Command Error

Results 1 to 2 of 2

Thread: Select Command Error

  1. #1
    Join Date
    Dec 1969
    Posts
    146

    Default Select Command Error

    Hi,<BR>I am trying to use the template that was written at 4guysfromrolla. It works fine until I go to call up an Employee ID. This is the error I get<BR><BR>Error Type:<BR>Microsoft VBScript runtime (0x800A01A8)<BR>Object required: &#039[string: "SELECT * FROM employ"]&#039<BR>/template/template.asp, line 6<BR><BR>Below is a copy of the complete script. Please help.<BR><BR><BR><BR>&#060;%<BR><BR>If Request.QueryString("EmpID") = "" Then<BR> Response.Redirect "Employee.asp"<BR>End If<BR><BR> set cnADO = Server.CreateObject("ADODB.Connection")<BR> dsnDSN = "dsn=template"<BR> cnADO.Open dsnDSN<BR> set mySQL = "SELECT * FROM EMPLOY WHERE ID=" & Request.QueryString("EmpID")<BR> set rsTemp = cnADO.Execute(mySQL)<BR><BR> <BR> If rsTemp.EOF then<BR> Response.Redirect "notfound.htm"<BR> Else<BR><BR>%&#062;<BR>&#060;html&#062;<BR> &#060;head&#062;<BR> &#060;title&#062;&#060;%=rsTemp("FullName")%&#062; &#060;/title&#062;<BR> &#060;/head&#062;<BR> &#060;body&#062;<BR>&#060;%<BR> set fso = Server.CreateObject("FileSystemObject")<BR> set ourtext = fso.GetFile("template.tmp")<BR><BR> &#039Open a file for reading<BR> set ts = ourtext.OpenAsTextStream(1,-2)<BR><BR> Do while not ts.AtEndOfStream<BR> myText = ts.readline<BR> myText = replace(myText, "%img%", rsTemp("picURL"))<BR> myText = replace(myText, "%name%", rsTemp("FullName"))<BR> duties = replace(rsTemp("duties"), vbCrLf, "<BR>")<BR> myText = replace(myText, "%duties%", duties)<BR> myText = replace(myText, "%empID%", rsTemp("ID"))<BR> myText = replace(myText, "%date%", rsTemp("PicCaption"))<BR> Response.Write myText<BR> Loop<BR><BR><BR> &#039Clean up...<BR> set ts = nothing<BR> set ourtext = nothing<BR> set fso = nothing<BR><BR> rstemp.close<BR> set rstemp = nothing<BR><BR> cnADO.Close<BR> set cnADO = nothing<BR><BR>end if<BR>%&#062;<BR> &#060;/body&#062;<BR>&#060;/html&#062;<BR><BR>Thanks, any help would be greatly appreciated.

  2. #2
    Join Date
    Dec 1969
    Posts
    73

    Default RE: Select Command Error

    you didn&#039t define any objects: <BR><BR>Dim cnADO, dsnDSN, mySQL, rsList<BR><BR>Otherwise i way of the line :)<BR>

Posting Permissions

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