473,804 Members | 4,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

table does not exist error in AD query?

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_SUBTR EE = 2
Set objConnection = CreateObject("A DODB.Connection ")
Set objCommand = CreateObject("A DODB.Command")
objConnection.P rovider = "ADsDSOObje ct"
objConnection.O pen "Active Directory Provider"
Set objCommand.Acti veConnection = objConnection
objCommand.Comm andText = "Select printerName, serverName from " _
& " 'LDAP://DC=corp,DC=COMP ANY,DC=com' where objectClass='pr intQueue'"
objCommand.Prop erties("Page Size") = 1000
objCommand.Prop erties("Timeout ") = 30
objCommand.Prop erties("Searchs cope") = ADS_SCOPE_SUBTR EE
objCommand.Prop erties("Cache Results") = False
Set objRecordSet = objCommand.Exec ute
objRecordSet.Mo veFirst
Do Until objRecordSet.EO F
Set oPrinterName = objRecordSet.Fi elds("printerNa me").Value
Set oServerName = objRecordSet.Fi elds("serverNam e").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.Mo veNext

Loop
Jul 19 '05 #1
0 5751

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11862
by: Jonathan | last post by:
I am looking for a simple way to check if a database table exists. I keep getting advice to use "Try.. Catch" and other error handling methods, but I obviously don't want to have to display an error message and stop the process every time someone loads the script after the table is created because that would mean the page could only ever run once which of course not the solution I was looking for. I simply want to know how I can check...
6
3762
by: pb648174 | last post by:
I have a pivot table implementation, part of which is posted below. It returns no errors in query analyzer, but when profiler is run, it shows that "Error 208" is happening. I looked that up in BOL and it means that an object doesn't exist. This block of code below works fine on my local development machine, but not on our shared development server until I go into the tempdb and make the user have the role db_owner. Even wierder is that...
1
4577
by: Juris Krumins | last post by:
Couple a weeks ago (19.08.03 Subject: Temporaty tables) I've posted message with question about errors I'm getting while using create temporaty table command. So I'm start digging in src code as Tom Lane did and found about 4 places where such kind pf errors could happend PostgreSQL 7.3.3 src/backend/catalog/dependency.c : 1621 src/backend/catalog/heap.c : 1663
3
11389
by: Terrence Brannon | last post by:
I don't know what Postgres considers a relation and had no intention of creating one when piping my schema to it... I always DROP TABLE before CREATE TABLE, so here are the ERRORS emitted when building the database: 3:ERROR: table "country" does not exist 6:ERROR: table "customer" does not exist 11:ERROR: table "product" does not exist 15:ERROR: table "license" does not exist 19:ERROR: table "enduser" does not exist 24:ERROR: ...
3
5913
by: Michael Magg | last post by:
Hello! I wanna import a table with a makro, but a table with this name already exists. So the imported table (f. i. "table") is saved as "table1". How can I check, if such a table already exists and then delete it? So how can I check the existence of a table? ________________________________________ Function Importieren1() On Error GoTo Importieren1_Err
4
2862
by: Alan Lane | last post by:
Hello world: I'm including both code and examples of query output. I appologize if that makes this message longer than it should be. Anyway, I need to change the query below into a pivot table query. I'm having trouble doing it. Help! Here is my code so far: Sub OldRegionQuery()
5
3945
by: phillip.s.powell | last post by:
$sql = "SELECT IF((SHOW TABLES LIKE '$subselectTableName'), count(*), NULL) AS numRows FROM $subselectTableName"; I am trying to write a SQL statement that will tell me if a table exists or not, this is because PHP will throw Fatal Errors and halt all programming if the table does not exist that I attempt to query. How do you write an elegant MySQL 4.1+ statement to detect if a table exists or not?
0
4727
by: amit | last post by:
The Table tt_local will be created when you execute the procedure. The table does not exist when you compile it. There are two options 1. Create the global temporary table manually Remove the creation of the table from the proc and then compile it. 2. Run the insert also as dynamic sql. Remember dynamic sqls don't go through semantic check at compile time.
7
2797
by: quincy451 | last post by:
drop table . CREATE TABLE . ( NULL , (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , NULL , NULL , (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , (16) COLLATE
3
10380
by: moltendorf | last post by:
I copied the files from my "test" database on my old server (MySQL was not running) to my new server ("./mysql/data/test" folder), and after starting the server, SHOW TABLES; shows all of the tables that are supposed to be there, but running a SELECT * FROM `configuration`; (for example) returns "test.configuration does not exist). I've tried the following repair statement since I'm not too familiar with backing up and restoring data. ...
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.