I am new to
ASP and been bugged down with this problem.
<font color="red">Below is a portion of my code and it runs perfectly:
Now when I change the value of formCategory it will call the function CheckRequiredText() and that is where I encounter problem</font id="red">
<%
varStaffName=Request.Cookies("varStaffName")
varDescription=Request.Cookies("varModuleDescripti on")
formDateFrom=Request.Cookies("varFormDatefrom")
formDateTo=Request.Cookies("varFormDateTo")
strSQL= " SELECT ModuleCode, ProgressComponentCode, ProgressComponentDesciption, ProgressComponentWeight"
strSQL= strSQL + " FROM dbo.ProgressReportComponent WHERE ModuleCode = " & varModulelD
strSQL= strSQL + " ORDER BY ProgressComponentDesciption "
'response.write(strSQL)
Set Re2 = conn.Execute(strSQL)
%>
<select name="formCategory" size="1" style="width:200;COLOR:#669966;" onChange="CheckRequiredText() ">
<%
strSQL3= " SELECT ProgressReportCommentsTypeCode, ProgressReportCommentsTypeDescription"
strSQL3= strSQL3 + " FROM dbo.ProgressReportCommentType WHERE ModuleCode = " & varModulelD
Set Re3 = conn.Execute(strSQL3)
do until Re3.EOF
response.write "<option value= " & Re3("ProgressReportCommentsTypeCode") & "> " & Re3("ProgressReportCommentsTypeDescription") & "</option>"
Re3.MoveNext
loop
Re3.close
Set Re3 = Nothing
%>
</select>
<font color="red">This is my CheckRequiredText() function. Everything is working on my function except when it connects to the database. That is when I get the error message "Error 424 Object Required" I can't figure out why my connection string is not working.</font id="red">
<SCRIPT LANGUAGE = "VBScript">
<!--
Private Function CheckRequiredText()
MsgBox "The " & Form.formCategory.options(Form.formCategory.select edIndex).value & " was the selected code."
varTypeCode= Form.formCategory.options(Form.formCategory.select edIndex).value
strSQL4=" SELECT ProgressReportCommentCode, ProgressReportCommentTypeCode, ProgressReportCommentDescription"
StrSQL4=strSQL4 + " FROM dbo.ProgressReportComment WHERE ProgressReportCommentTypeCode = " & varTypeCode
On Error Resume Next
MsgBox StrSQL4
Set Re4 = conn.Execute(strSQL4)
MsgBox "Error # " & CStr(Err.Number) & " " & Err.Description
End Function
----------------------------
<font color="red">This is the value of my conn</font id="red">
Set conn = Server.CreateObjectADODB.Connection)
conn.ConnectionTimeout = 30
conn.CommandTimeout = 30
conn.Open (Provider=SQLOLEDB;UID=ourUserID;Password=ourPassw ord;Initial Catalog=ourCatalog;Data Source=ourdatabasename and location)
Can someone help me figure out the solution to my problem.