Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SQL Server abfragen

Empfohlene Antworten

Veröffentlicht

Hi,

ich versuche gerade ein script zu basteln, welches mir die doppelten pc's im wsus auflistet.

Leider habe ich schon beim zugriff auf die datenbank probleme.

Anbei mal das script:

'SYS: Microsoft (r) Script Runtime

Set fs = CreateObject("Scripting.FileSystemObject")

'SYS: Windows Script Host Runtime Library

Set wshshell = CreateObject("WScript.Shell")


filename = "c:\test.txt"



'Ordnername finden in dem das Script liegt

myname = WScript.ScriptFullName

mypath = Left(myname, InSTrRev(myname, "\"))


'Datenbank öffnen

'SYS: Microsoft Data Access - Active X Data Objects

Set db = CreateObject("ADODB.Connection")

db.Open("PROVIDER=SQLOLEDB;Data Source=sus01\WSUS; Catalog=SUSDB; Integrated Security=SSPI")


'Über SQL Daten auslesen

sql = "select * from SUSDB"

Set rs = db.Execute(sql)


'Alle Ergebnisse in Datei Speichern

Do Until rs.EOF

For x = 0 to 5

list = list & rs(x) & vbTab

Next

list = list & vbCr

rs.MoveNext

Loop


Set fs = CreateObject(Scripting.FileSystemObject)


On Error Resume Next

Set textstream = fs.OpenTextFile(filename, ForWriting, True)

ok = (Err.number = 0)

If ok Then

	On Error Goto 0

	textstream.Writelin list

	textstream.Close

End If

Wenn ich das Script starten kommt folgende Fehlermeldung:

Windows Scripting Host

Zeile 20

Zeichen 1

Fehler Invalid object name 'SUSDB'

Code 80040E37

Quelle Microsoft OLE DB Provider for SQL Server

SUS DB habe ich aus der registy ausgelesen..

Das ganze läuft auf einer MSDE unter W3k Sp1

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.