PDA

View Full Version : vbscript object error (WXP-Pro)



mat757
06-05-2006, 08:14 AM
I am trying to populate a form text box with an employee ID from an access database using a button in a vbscript. When I click the button at runtime I get the following error:
"Error Oject Required: objrs" objrs is the record set I pull out of the database.

I have included the code used below:
<!--#INCLUDE VIRTUAL="/includes/connection.asp" -->
<!--#include virtual= "includes/adovbs.inc"-->

<script LANGUAGE="vbscript">

Option Explicit
DIM mySQL
Public objRS
mySQL = "SELECT * FROM Employees"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, objConn, 3





sub cmdID_OnClick()
document.frmWOrequest.txtEmployeeID.value = objRS.Fields.value("EmployeeID")

end sub

Does anyone see what I'm doing wrong ?

Thanks.....


</script>
</head>

Brf
06-06-2006, 07:08 PM
A client-side script is not going to be able to use that server object to create a recordset.... That is used in server-side scripts, such as ASP.