table does not exist error in AD query?

Discussion in 'ASP General' started by Aaron_TekRecycle.com, Jul 25, 2003.

  1. this runs perfectly as a .vbs but I'd like to convert it to an ASP... any
    ideas?

    Response.Buffer = True
    Dim objConnection, objCommand, objRecordSet
    Dim oPrinterName, oServerName

    Const ADS_SCOPE_SUBTREE = 2
    Set objConnection = CreateObject("ADODB.Connection")
    Set objCommand = CreateObject("ADODB.Command")
    objConnection.Provider = "ADsDSOObject"
    objConnection.Open "Active Directory Provider"
    Set objCommand.ActiveConnection = objConnection
    objCommand.CommandText = "Select printerName, serverName from " _
    & " 'LDAP://DC=corp,DC=COMPANY,DC=com' where objectClass='printQueue'"
    objCommand.Properties("Page Size") = 1000
    objCommand.Properties("Timeout") = 30
    objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
    objCommand.Properties("Cache Results") = False
    Set objRecordSet = objCommand.Execute
    objRecordSet.MoveFirst
    Do Until objRecordSet.EOF
    Set oPrinterName = objRecordSet.Fields("printerName").Value
    Set oServerName = objRecordSet.Fields("serverName").Value
    Set oServerPrinter = "\\" & oServerName & "\" & oPrinterName

    'Wscript.Echo "Printer Name: " & oPrinterName & vbcr & "Server Name: " &
    oServerName (for .vbs)

    ' Display Printers on web page (for ASP)
    Response.Write "Printer Name: " & oPrinterName
    Response.Write vbcrlf
    Response.Write "Server Name: " & oServerName

    objRecordSet.MoveNext

    Loop
    Aaron_TekRecycle.com, Jul 25, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brad
    Replies:
    1
    Views:
    26,305
    [MSFT]
    Jun 22, 2004
  2. LT
    Replies:
    7
    Views:
    2,094
    Phlip
    Jul 25, 2004
  3. Wake-Up-Jeff

    Table does not exist error.

    Wake-Up-Jeff, Apr 14, 2009, in forum: ASP .Net
    Replies:
    3
    Views:
    1,094
    Wake-Up-Jeff
    Apr 20, 2009
  4. Wake-Up-Jeff

    Table does not exist error

    Wake-Up-Jeff, Apr 14, 2009, in forum: ASP .Net Security
    Replies:
    3
    Views:
    1,380
    Joe Kaplan
    Apr 20, 2009
  5. Ollie
    Replies:
    1
    Views:
    1,308
    Ollie
    Apr 29, 2004
Loading...

Share This Page