Wrox Programmer Forums
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 14th, 2009, 10:41 AM
Registered User
 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to use GetObject()

Is there a way to call GetObject() and have it return resources from another server?

I am working with the Microsoft Internet Printing Project which is hosted through IIS6. All of our printer resources are located on a shared print server. If I could point my ASP pages to a shared network drive instead of something on the C:/ drive that would be great.

Here is the trouble code:

Code:
  
 
'***********************************************************
' FUNCTION rgADSIGetPrinters()
'***********************************************************
Function rgADSIGetPrinters(strComputer, iStart, iEnd)
    On Error Resume Next
    Err.Clear
    Dim objPrinter, objPrinters, objServerPrinters, iPrinters, dwStatus, rgPrinters()
    Dim objHelper, i
    Dim iTotal, iRevStart, iRevEnd
    Dim strStatus
    Dim strHTML
 
    If strComputer = "localhost" Or strComputer = "127.0.0.1" Then
        Set objHelper = Server.CreateObject(PROGID_HELPER)
        strComputer = objHelper.ComputerName
    End If
    iPrinters = 0
 
   Set objPrinters = GetObject("WinNT://" & strComputer & ",computer")
....
....
....
    if iPrinters = 0 Then ReDim rgPrinters(ADSI_PRINTER_SHARE, 0)
    rgADSIGetPrinters = rgPrinters
End Function

Any help is greatly appreciated : )





Similar Threads
Thread Thread Starter Forum Replies Last Post
GetObject jdhock8865 Visual Basic 2005 Basics 2 November 3rd, 2008 09:29 PM
getobject() failure- recent Loralee Access 2 November 24th, 2006 02:29 PM
GetObject Trap bostek VBScript 2 November 24th, 2004 02:39 AM
why GetObject with IIS is not working alyeng2000 ASP.NET 1.x and 2.0 Application Design 0 September 15th, 2004 09:00 AM
UCOMIRunningObjectTable.GetObject wstueve C# 0 December 18th, 2003 11:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.