Click here to Skip to main content
16,010,544 members
Home / Discussions / Web Development
   

Web Development

 
QuestionGetting the file name using the outputstream Pin
kramkrish15-Dec-05 19:18
kramkrish15-Dec-05 19:18 
AnswerRe: Getting the file name using the outputstream Pin
enjoycrack16-Dec-05 8:20
enjoycrack16-Dec-05 8:20 
AnswerRe: Getting the file name using the outputstream Pin
Guffa16-Dec-05 22:39
Guffa16-Dec-05 22:39 
Question<t:ANIMATEMOTION> Pin
TheEagle15-Dec-05 18:19
TheEagle15-Dec-05 18:19 
QuestionHow to refresh iFrame content ? Pin
vicky45715-Dec-05 13:41
vicky45715-Dec-05 13:41 
QuestionRegEx issue repeating characters Pin
OmegaMan15-Dec-05 9:41
OmegaMan15-Dec-05 9:41 
AnswerRe: RegEx issue repeating characters Pin
OmegaMan15-Dec-05 11:10
OmegaMan15-Dec-05 11:10 
QuestionInscrutable Type Mismatch Errors Pin
Corbett Kroehler15-Dec-05 8:07
Corbett Kroehler15-Dec-05 8:07 
I've taken Charles Oppermann's wonderful address book command line VBScript (which works perfectly) and tried to adapt it to run inside a basic web application. I keep encountering ASP 0106 : 80020005 errors when I run the following. The method is identical to the way it's done in the command line .vbs so I can't figure out why my variable throws a type mismatch. Help!

= = = = = = = = = =<br />
<br />
<%@ LANGUAGE="VBSCRIPT" %><br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
<html><br />
<head><br />
<title>LDAP Lookup</title><br />
<style type="text/css"><br />
body, input, select, table, textarea<br />
{<br />
font-size: 9pt;<br />
font-family: arial;<br />
<br />
}<br />
<br />
.niceButton {<br />
	font-size : 9pt;<br />
	font-family : arial;<br />
	background-color : #eaeaea;<br />
	color : #333333;<br />
	font-weight : bold;<br />
	border-width : thin;<br />
}<br />
</style><br />
<%<br />
dim strPerson<br />
strPerson = trim(request.form("last"))<br />
    Set objADsRootDSE = GetObject("GC://RootDSE")<br />
        <br />
    strADsPath = "GC://" & objADsRootDSE.Get("rootDomainNamingContext")<br />
    <br />
    ' Wrap the ADsPath with angle brackets to form the base string<br />
    strBase = "<" & strADsPath & ">"<br />
    <br />
    ' Release the ADSI object, no longer needed<br />
    Set objADsRootDSE = Nothing<br />
    <br />
    ' Specify the LDAP filter<br />
    ' First, indicate the category of objects to be searched (all people, not just users)<br />
    strObjects = "(objectCategory=person)"<br />
    <br />
    ' If user enters "*", then filter on all people<br />
    If (strPerson = "*") Then<br />
        strName = "(sn=*)"<br />
    Else<br />
        strName = "(sn=" & strPerson & "*)"<br />
    End If<br />
    <br />
    ' Add the two filters together<br />
    strFilter = "(&" & strObjects & strName & ")"<br />
    <br />
    ' Set the attributes we want the recordset to contain<br />
    ' We're interested in the common name and telephone number<br />
    strAttributes = "cn,telephoneNumber"<br />
    <br />
    ' Specify the scope (base, onelevel, subtree)<br />
    strScope = "subtree"<br />
    <br />
    ' Create ADO connection using the ADSI OLE DB provider<br />
    Set objADOConnection = CreateObject("ADODB.Connection")<br />
    objADOConnection.Open "Provider=ADsDSOObject;"<br />
    <br />
    ' Create ADO commmand object and associate it with the connection<br />
    Set objADOCommand = CreateObject("ADODB.Command")<br />
    objADOCommand.ActiveConnection = objADOConnection<br />
    <br />
    ' Create the command string using the four parts<br />
    objADOCommand.CommandText = strBase & ";" & strFilter & ";" & strAttributes & ";" & strScope<br />
    <br />
    ' Set the number of records in the recordset logical page<br />
    'objADOCommand.Properties("Page Size") = 20<br />
    <br />
    ' Set the maximum result size<br />
    objADOCommand.Properties("Size Limit") = 20<br />
    <br />
    ' Sort the results based on the cn attribute<br />
    objADOCommand.Properties("Sort On") = "cn"<br />
    <br />
    ' Execute the query for the user in the directory<br />
    Set objADORecordset = objADOCommand.Execute<br />
    <br />
    If objADORecordset.EOF Then<br />
        strDisplayLine = "No records were found."<br />
    Else<br />
        ' Loop through all the returned records<br />
        While Not objADORecordset.EOF<br />
        <br />
            ' Display the row using the selected fields<br />
            strDisplayLine = objADORecordset.Fields("cn") & vbTab<br />
        <br />
            ' Check to see if telephone number field is null<br />
            If IsNull(objADORecordset.Fields("telephoneNumber")) Then<br />
                strDisplayLine = strDisplayLine & "(number not listed)"<br />
            Else<br />
                ' Retrieve telephone number and add to line<br />
                strDisplayLine = strDisplayLine & objADORecordset.Fields("telephoneNumber")<br />
            End If<br />
        <br />
            ' Advance to the next record<br />
            objADORecordset.MoveNext<br />
        <br />
        Wend<br />
    End If<br />
            <br />
    ' Close the ADO connection<br />
    objADOConnection.Close<br />
<br />
%><br />
</head><br />
<body text="#333333"><%=strDisplayLine%></div></html><br />


-- modified at 14:07 Thursday 15th December, 2005
QuestionE-recruitment Pin
marmosha15-Dec-05 8:06
marmosha15-Dec-05 8:06 
AnswerRe: E-recruitment Pin
Brian Van Beek15-Dec-05 9:33
Brian Van Beek15-Dec-05 9:33 
AnswerRe: E-recruitment Pin
marmosha16-Dec-05 22:48
marmosha16-Dec-05 22:48 
QuestionRegd. Printing html tables Pin
DotnetProVan15-Dec-05 6:24
DotnetProVan15-Dec-05 6:24 
QuestionRun Excel Spreadsheet with macros from the browser Pin
DarkAngel78615-Dec-05 5:30
DarkAngel78615-Dec-05 5:30 
QuestionOpening a new Window from a Word Document in an IFrame Pin
bwhittington15-Dec-05 4:35
bwhittington15-Dec-05 4:35 
AnswerRe: Opening a new Window from a Word Document in an IFrame Pin
Brent Lamborn15-Dec-05 5:06
Brent Lamborn15-Dec-05 5:06 
GeneralRe: Opening a new Window from a Word Document in an IFrame Pin
bwhittington15-Dec-05 5:40
bwhittington15-Dec-05 5:40 
Questionshell32.dll file source code Pin
ramialadwan15-Dec-05 2:33
ramialadwan15-Dec-05 2:33 
Questioncreating user for windows from logon screen by using internet not intranet Pin
ramialadwan15-Dec-05 2:25
ramialadwan15-Dec-05 2:25 
Questionproblem using dll on server Pin
uktrips00715-Dec-05 2:22
uktrips00715-Dec-05 2:22 
AnswerRe: problem using dll on server Pin
enjoycrack15-Dec-05 7:33
enjoycrack15-Dec-05 7:33 
GeneralRe: problem using dll on server Pin
uktrips00715-Dec-05 18:27
uktrips00715-Dec-05 18:27 
GeneralRe: problem using dll on server Pin
enjoycrack16-Dec-05 8:15
enjoycrack16-Dec-05 8:15 
Questionpopup window Pin
priti shetty14-Dec-05 19:30
priti shetty14-Dec-05 19:30 
Questionsend mail problem Pin
morgan8514-Dec-05 15:18
morgan8514-Dec-05 15:18 
AnswerRe: send mail problem Pin
enjoycrack14-Dec-05 19:18
enjoycrack14-Dec-05 19:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.