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.

VBS Subscript out of range

Empfohlene Antworten

Veröffentlicht

Hallo,

ich soll ein Script erstellen, welches die Datenbanken auf unseren Server ausliest und diese gesplittet darstellt. Allerdings tritt bei mir immer das Runtime Error 9 auf, welches sich auf die Zeile 33/Char2 bezieht.

Ich hoffe ihr könnt mir einen kleinen Hinweis zur Behebung des Problemes geben.

Dim Cn

Dim Rs

Dim Db 

Dim DbSplit

Dim arrDb()

Const adClipString = 2

Set Cn = Wscript.createObject("ADODB.Connection")

Set Rs = Wscript.createObject("ADODB.Recordset")


Dim String_Datenbanken


with Cn

	'Provider zuweisen

	.Provider = "SQLOLEDB.1"

	'ConnectionString übergeben

	.ConnectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=XXX;Data Source=XXX"

	'Connection öffnen

	.Open

End with


With Rs

	.Open "SELECT name FROM sys.databases ", Cn

End With


String_Datenbanken = Rs.GetString(adClipString,,,VBCRLF )


	Db = split(String_Datenbanken,VBCRLF)


	Redim	arrDb(Ubound(Db))


For i = 0 TO Ubound(Db)

	DbSplit = split(Db(i))

	arrDb(i) = DbSplit(0)

Next


For Each value in arrDb

	MsgBox value

next		


Cn.close

  • Autor

Zeile 33 ist :

arrDb(i) = DbSplit(0)

Entschuldige, habe es vergessen und danke für deinen Tipp. Werde es umgehend überprüfen und mich wieder melden

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.