|
-
Mar 6th, 2001, 02:47 PM
#1
Thread Starter
Fanatic Member
The following code is breaking on the objrs.open. Can you help???? Thanks....
**************************************
**************************************
<% @Language = VBScript %>
<%
Option Explicit
Dim objConn, objRs, strQ, strMeth
'Change the display of boolean value to image
function YesNo()
' If bool value is true, return yes.
if objRs("present") = true then
YesNo = "<img src=images/imgIn.gif>"
' If bool value is false, return no.
else
YesNo = " "
end if
end function
'check form for sorting method and assign SQL and Text
If Trim(Request.Form("radsort")) = "fin" then
strMeth = "Financial Services"
strQ = "select e.lname, e.fname, e.PhoneNumber, e.ACESID, i.in, e.UserName from tblEmployees e, tblInOut i where e.Unit='fin1, fin2, fin3, fin4' order by e.lname"
ElseIf Trim(Request.Form("radsort")) = "soc" then
strMeth = "Social Services"
strQ = "select e.lname, e.fname, e.PhoneNumber, e.ACESID, i.in, e.UserName from tblEmployees e, tblInOut where e.Unit='Soc Serv1, Soc Serv2' order by e.lname"
ElseIf Trim(Request.Form("radsort")) = "cler" then
strMeth = "Support Services"
strQ = "select e.lname, e.fname, e.PhoneNumber, e.ACESID, i.in, e.UserName from tblEmployees e, tblInOut i where e.Unit='SUPPORT SERVICES' order by e.lname"
ElseIf Trim(Request.Form("radsort")) = "whosin" then
strMeth = "Whos in?"
strQ = "select e.lname, e.fname, e.PhoneNumber, e.ACESID, i.in, e.UserName from tblEmployees e, tblInOut i where i.In=True order by e.lname"
Else strMeth = "Alphabetical"
strQ = "select e.lname, e.fname, i.in, e.phonenumber, e.Username from tblEmployees e, tblInOut i order by e.lastname"
End If
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=g:\InOut\dbInOut.mdb"
set objRs = Server.CreateObject("ADODB.Recordset")
objRs.Open strQ, objConn
%>
**********************************************
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|