Hallo Mario,
du willst alle Konf. einer Datei als Liste ?
Als erzeuge eine Datei mit endung .vbs
und kopiere die unteren Daten rein.
Anschließend das Skript über die Shortcutbar einbinden oder als Datei unter der RMT im Verzeichnis LST\A und LST\P kopieren
Sub main()
DBWInit(TRUE)
Call DBWShell( "CurrentDocument" )
if (okDBW = False) then
MsgBox "Bitte zuerst ein Dokument anwahlen!"
exit sub
end if
DocUid = DBWResult( "@DOCUMENT_UNIQUE_ID" )
'MSGBox "ID "& DocUid
'Dateiname = DBWResult("@DOCUMENT_ID")
'MSGBOX "Dateiname: " &Dateiname
'######################################################################################
Set collegamento = CreateObject("ADODB.Connection")
Set risultati = CreateObject("ADODB.Recordset")
collegamento.Open "DBWORKS", "DBWORA", "sql"
query= "SELECT * FROM DOKUMENT WHERE EINDEUTIGE_NR =" & DocUid & ""
'----------------------------------------------------------------------------------
'MSGBox "query= " & query
risultati.Open query, collegamento,1
number_of_revisions = risultati.recordcount
'MsgBox "number_of_revisions " & number_of_revisions
If number_of_revisions <> 0 Then
DATEI_NAME = risultati.Fields("DATEI_NAME").value
DATEI_VERZEICHNIS = risultati.Fields("DATEI_VERZEICHNIS").value
GESAMT = DATEI_VERZEICHNIS & DATEI_NAME
End If
If DATEI_NAME = "" Or IsNull(DATEI_NAME) OR DATEI_VERZEICHNIS = "" Or IsNull(DATEI_VERZEICHNIS)Then
MsgBox "Konnte das Dokument nicht über den Dateinamen finden"
Set risultati = Nothing
collegamento.Close
Set collegamento = Nothing
Exit Sub
End If
Set risultati = Nothing
collegamento.Close
Set collegamento = Nothing
Set fs = CreateObject("Scripting.FileSystemObject")
Set tfolder = fs.GetSpecialFolder(TemporaryFolder)
queryFileName = tfolder & "\PartListSample.sql"
Set a = fs.OpenTextFile( queryFileName, ForWriting, True )
a.WriteLine( "SELECT * FROM DOKUMENT WHERE DATEI_NAME = '" & DATEI_NAME & "' AND DATEI_VERZEICHNIS = '" & DATEI_VERZEICHNIS & "'" )
a.Close
DBWShell("LoadQuery " & queryFileName )
if( okDBW = False ) then exit sub
End Sub
Gruss
Bernd
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP