Versuche doch mal den Login über die IE Funktionen. In der Hilfe steht alles dazu
Gruß gmmg
Versuche doch mal den Login über die IE Funktionen. In der Hilfe steht alles dazu
Gruß gmmg
na super
Viele Grüße
gmmg
Wer hat denn diesen Prozess definiert, dass du die Datei nicht kennst ? Wird die Excel automatisch erzeugt und dann in einen Pfad xy abgelegt?
Irgendeiner muss die Datei ja öffnen. Geschiet das aus einem Programm heraus oder von Hand?
wie Water geschrieben hat, so sollte es gehen.
Die Dateien mit Filelist auflisten lassen und nacheinander abarbeiten wäre auch möglich.
Hier noch ein Beispiel zum auslesen eines Existierenden Files.
#include <Excel.au3>
Local $aWorkBooks = _Excel_BookList()
;_ArrayDisplay($aWorkBooks)
$sFileName = $aWorkBooks[0][2] & "\" & $aWorkBooks[0][1]
Local $oExcelDoc = ObjGet($sFileName) ; Get an Excel Object from an existing filename
$aArray = _Excel_RangeRead($oExcelDoc, Default,Default)
_ArrayDisplay($aArray)
Alles anzeigen
Gruß gmmg
Hier mal ein Beispiel mit einer Excel Datei, die du Öffnen musst.
Könntest deine ja auch
$path = @ScriptDir & "\test.xlsx"
Local $oExcelapp = _Excel_Open(0,0,1,1,1)
Local $oExcel = _Excel_BookOpen($oExcelapp, $path)
If @error = 1 Then
MsgBox(0, "Error!", "Unable to Create the Excel Object")
Exit
ElseIf @error = 2 Then
MsgBox(0, "Error!", "File does not exist - Shame on you!")
Exit
EndIf
$aArray = _Excel_RangeRead($oExcel,Default,Default)
_Excel_BookClose($oExcel, True)
_Excel_Close($oExcelapp, Default, True)
_ArrayDisplay($aArray, "Array using Default Parameters")
$activeSheet = $oWorkbook.ActiveSheet.Name ; prüfe welches Sheet aktiv
If $activeSheet <> $id Then $oWorkbook.Sheets($id).Activate ; aktiviere sheet mit accountname, wenn nicht schon aktiv ($id = Sheetname)
Alles anzeigen
gruß gmmg
die Query sollte so aussehen wie im Beispiel aussehen...
Beispiel
; schleife durch Array, Werte erzeugen und übergeben
$sQuery = "INSERT INTO tabelle_xyz (`Feld1`,`Feld2`,`Feld3`,`Feld4`) VALUES ('" & $s_wert[1] & "', '" & $s_wert[2] & "', '" & $s_wert[3] & "', '" & $s_wert[4] & "')"
Zum testen auch einfach mal die Query über Consolewrite($query) ausgeben lassen und den String direkt im Access testen
gruß gmmg
die Access UDF brauchst du da nicht zwingend und es gibt hier im Forum auch schon paar Beiträge zum MS Access.
Hier mal ein einfacher Insert in eine Access accdb. (Datei im Anhang)
$dbname = "d:\test.accdb"
_access_write($dbname)
Func _access_write($dbname)
$adoCon = ObjCreate("ADODB.Connection")
$adoCon.Open("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & $dbname & ";")
$adoRs = ObjCreate("ADODB.Recordset")
;$adocon = ObjCreate("ADODB.Connection")
;$adocon.open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $dbname)
;$adors = ObjCreate("ADODB.Recordset")
Local $sQuery = "INSERT INTO TB1 (`Name`,`Vorname`) VALUES ('Meier','Wolfgang')"
;Local $sQuery = 'UPDATE TB1 SET [01_MA].SID = "' & $sid & '" WHERE [01_MA].PC = "' & $ssamaccountname & '"'
$adoCon.Execute($sQuery)
$adoCon.Close
EndFunc
Alles anzeigen
gruß gmmg
Hier mal paar Beispiele. jeweils in eine Funktion gepackt.
$dbname = "\\server\test.mdb"
Func _access_write($dbname, $ssamaccountname, $sid)
;$adoCon = ObjCreate("ADODB.Connection")
;$adoCon.Open("Provider=Microsoft.ACE.OLEDB.12.0; Jet OLEDB:Database Password=" & $s_db_pwd & "; Data Source=" & $datenbankpfad & ";")
;$adoRs = ObjCreate("ADODB.Recordset")
;$adoRs.CursorType = 1
;$adoRs.LockType = 3
$adocon = ObjCreate("ADODB.Connection")
$adocon.open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $dbname)
$adors = ObjCreate("ADODB.Recordset")
;Local $sQuery = "INSERT INTO 01_MA (`SID`) VALUES ("'" & $sid & "')"
Local $sQuery = 'UPDATE 01_MA SET [01_MA].SID = "' & $sid & '" WHERE [01_MA].PC = "' & $ssamaccountname & '"'
$adoCon.Execute($sQuery)
$adoCon.Close
EndFunc
Func _user()
$tblname = "01_MA"
$fldname01 = "PC"
; $query = "SELECT * FROM " & $tblname & " WHERE AS400 = " & "'" & $ssamaccountname & "'"
; $query = 'SELECT 01_MA.SID FROM 01_MA WHERE 01_MA.PC <> " " AND 01_MA.Ausgeschieden="False"'
$query = 'SELECT PC FROM 01_MA WHERE PC <> " " And Ausgeschieden = False And SID is Null'
$strdata = _readonefld($query, $dbname, $fldname01)
EndFunc
Func _readonefld($_sql, $_dbname, $_field)
Dim $_output
$adocon = ObjCreate("ADODB.Connection")
$adocon.open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $_dbname)
$adors = ObjCreate("ADODB.Recordset")
$adors.cursortype = 1
$adors.locktype = 3
$adors.open($_sql, $adocon)
With $adors
If .recordcount Then
While NOT .eof
$_output = $_output & .fields($_field).value & "|"
.movenext
WEnd
EndIf
EndWith
$adocon.close
Return $_output
EndFunc
Alles anzeigen
gruß gmmg
Teste auf dem Client, auf dem das Autoit Script nicht läuft, ob du eine Verbindung über den MYSQL Administrator (neu Heißt das jetzt Workbench, brauchst du aber zum testen nicht) hinbekommst.
https://downloads.mysql.com/archives/administrator/ Version 1.1.9 ist die letzte für Windows
Falls das auch nicht klappt, prüfen ob das Antivirenprogramm/ Firewall auf dem Client etwas blockiert oder aber im Router der Hund begraben ist.
Alternativ kann man auch mit Wireshark den Netzwerkverkehr mitschneiden und schauen wo es klemmt. Erfordert aber etwas Kenntnis.
Auf deinem Handy hast du diese Dinge ja sicher nicht drauf oder? Von daher könnte es daran liegen.
Gruß gmmg
Ich benutze für solche Dinge die _MySQL_Real_Query aud der UDF.
Mit diesem kannst du das Insert, Select, Update abdecken.
Ein Beispiel für ein Update wäre zum Beispiel so.
$sQuery = "UPDATE Tabelle_Spieler SET `Punkte` = '110' WHERE `Spielername` = 'Max Mustermann' "
die Query dann am Besten mit Consorewrite ($sQuery) mal schreiben und schauen ob die Hochkommas, Leezeichen usw stimmen. Danach mal den String über phpadmin testen.
unten etwas komplexer
Local $sQuery = "UPDATE tab_vorgang SET " & _
"`UMSATZ isoliert EUR` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[2]) & _
"',`Aenderungsdatum` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[4]) & _
"',`TourLST` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[5]) & _
"',`RRKV Umsatz` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[6]) & _
"',`REISE-DAT` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[7]) & _
"',`Ag-Nr` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[8]) & _
"',`WVLKZ` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[9]) & _
"',`WVL-DAT` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[11]) & _
"',`ULA_DAT` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[10]) & _
"',`blankmarke` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[12]) & _
"',`offen` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[13]) & _
"' WHERE `Bu-Nr` = '" & _MySQL_Real_Escape_String($MysqlConn,$s_Row_txt_t1[1]) & "'"
_MySQL_Real_Query($MysqlConn, $sQuery)
Alles anzeigen
Gruß gmmg
Da will ich mich auch mal einbringen, habe jetzt nicht alle Posts gelesen, aber hast du mal probiert mit den Tools für MySQL zum Beispiel MySQL Administrator, auf die DB zuzugreifen?
Wenn das nicht geht, schau doch mal in den Einstellungen in der mysql.ini ob TCP/IP connections erlaubt sind. (Habe leider nur ein Screenshot vom MySQL Administrator)
Wenn das aktiv ist und es geht trozdem nicht, liegt es bestimmt an der Netzwerk/Router Konfiguration (Portweiterleitung etc. )
Gruß gmmg
Ich hatte mich auch mal Tage mit der Zip herumgeärgert und habe dann 7zip genommen.
Ein großer Vorteil hier ist, du kannst auch andere gängige Formate entpacken und istalliert muss das Programm ja auch nicht sein, weil du die dll oder exe ja dem Script mitgeben kannst.
Gruß gmmg
Hallo,
ich glaube dazu gab es schonmal etwas im Forum.
Ich selbst benutze aber immer 7zip. Anbei mal ein Beispiel zum entpacken. Dazu lege ich dem Script die 7zip.exe oder dll mit Fileinstall bei.
DirCreate(@Scriptdir & "\TEMP\")
FileInstall("D:\Data\7z.exe", @Scriptdir & "\TEMP\7z.exe", 1)
;FileInstall("D:\Data\7z.dll", @Scriptdir & "\TEMP\7z.dll", 1)
$Quelle = "C:\Test.zip"
$Ziel = "C:\entpackt\"
;---------unpack-------
RunWait(@ComSpec & " /c " & @ScriptDir & "\TEMP\7z.exe x " & '"' & $Quelle & '"' & " -aoa -y -o" & '"' & $Ziel & '"')
Alles anzeigen
Gruß gmmg
Du schreibst bei jedem Systemstart, da gibt es, falls du einen Server am laufen hast, auch die Möglichkeit der Gruppenrichtlinien oder auch Logonscripte.
gruß gmmg
Anbei nochmal ein Beispiel, wie man dann in eine andere Spalte schreibt.
#include <Array.au3>
#include <Excel.au3>
$path = "d:\excel_test..xls"
Local $oExcelapp = _Excel_Open(False)
Local $oExcel = _Excel_BookOpen($oExcelapp, $path)
Local $aArray = _Excel_RangeRead($oExcel,Default,Default)
_ArrayDisplay($aArray)
For $i = 0 to UBound($aArray) -1
;MsgBox(0,"",$aArray[$i])
_Excel_RangeWrite($oExcel, $oExcel.Activesheet, $aArray[$i], "B" & $i +1) ; das +1, weil das scheiben ja in B1 beginnen soll, das Array aber mit 0 beginnt.
Next
_Excel_BookClose($oExcel, True)
_Excel_Close($oExcelapp, Default, True)
Alles anzeigen
gruß gmmg
Hallo,
ja, das geht. Ich würde empfehlen, alle zeilen in ein array zu lesen und dieses dann abzuarbeiten.
Beispiel für ein komplettes auslesen des Excel Sheets.
#include <Array.au3>
#include <Excel.au3>
$path = "d:\Excel.xls"
Local $oExcelapp = _Excel_Open(False)
Local $oExcel = _Excel_BookOpen($oExcelapp, $path)
Local $aArray = _Excel_RangeRead($oExcel,Default,Default)
_Excel_BookClose($oExcel, True)
_Excel_Close($oExcelapp, Default, True)
_ArrayDisplay($aArray)
For $i = 0 to UBound($aArray) -1
;MsgBox(0,"",$aArray[$i][2]) ; muss angepasst werden, in dem abschnitt kannst du auch die Übergabe realisieren, am besten man erstellt eine Funktion und ruft diese auf. wie folgt.
_übergabe_an_anderes_Programm()
Next
Func _übergabe_an_anderes_Programm()
;hier den quelltext einfügen
Endfunc
Alles anzeigen
Bei fragen einfach mal melden. Im Forum sollte es auch diverse Beispiele geben.
Gruß gmmg
Wie hast du denn den Quelltext ausgelesen?
Hast du mal im Firefox das Plugin Firebug benutzt oder im IE11 mit der F12 Taste?
Damit arbeite ich immer, wenn es um das auslesen geht und da siehst du ja dann genau, ob dahinter eine andere Scriptsprache steckt ..
_IELinkClickByText ($oIE, "Link_Text")
Gruß gmmg
Hallo,
hier ein Beispiel für das schreiben in eine Access mdb und das auslesen einer Access accdb über die Access.au3.
Willst du direkt auf eine MS SQL Zugreifen, kannst du dir die sql_udf.au3 ansehen.
Hier habe ich leider nur Beispiel zum lesen, falls du was benötigst.
Beispiele sollten auch hier oder im englischen Forum zu finden sein.
;--------- Modify the variables below as desired or applicable -------
local $dbname = @ScriptDir & "\Report.mdb"
$tblname = "Reporting"
$fldname = "Kennziffer"
$fldname1 = "code"
$fldname2 = "Woher"
$fldname2 = "Sonstiges"
_access_write($w1, $w2, $w3, $w4)
Func _access_write($w1, $w2, $w3, $w4)
$FULL_MDB_FILE_NAME = $dbname
;$SQL_CODE = "select * from Reporting"
$CONN = ObjCreate("ADODB.Connection")
$CONN.Open('Driver={Microsoft Access Driver (*.mdb)};Dbq=' & $FULL_MDB_FILE_NAME & ';')
$RecordSet = ObjCreate("ADODB.Recordset")
Local $sQuery = "INSERT INTO Reporting (`Kennziffer`,`code`,`Woher`,`Sonstiges`)" & _
"VALUES ('" & $w1 & "',"& _ ;
"'" & $w2 & "'," & _ ;
"'" & $w3 & "'," & _ ;
"'" & $w4 & "')" ;
;ConsoleWrite($sQuery)
$CONN.Execute($sQuery)
$CONN.Close
EndFunc
; Hier noch ein Beispiel für das ausklesen einer Access accdb...
;$datenbankpfad = @ScriptDir & "\Test.accdb"
$datenbankpfad = "d:\Test.accdb"
$tabellenname = "Tabellentest"
$Spalte0 = "ID" ;nicht ID Spalte
$Spalte1 = "Stick" ;nicht ID Spalte
$Spalte2 = "Box" ;nicht ID Spalte
$query = "SELECT * FROM " & $tabellenname & " WHERE Box = '12' AND Stick = '3'"
$strData1 = _ReadOneFld($query, $datenbankpfad,$Spalte0)
ConsoleWrite($query& @CRLF &$strData1)
MsgBox(0,"",$query & @CRLF & "Ergebnis: " & $strData1)
Func _ReadOneFld($_sql, $_datenbankpfad, $_field)
Dim $_output
$adoCon = ObjCreate("ADODB.Connection")
$adoCon.Open("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & $datenbankpfad & ";")
$adoRs = ObjCreate("ADODB.Recordset")
$adoRs.CursorType = 1
$adoRs.LockType = 3
$adoRs.Open($_sql, $adoCon)
With $adoRs
If .RecordCount Then
While Not .EOF
$_output = $_output & .Fields($_field).Value
.MoveNext
WEnd
EndIf
EndWith
$adoCon.Close
Return $_output
EndFunc
;---------------------- schreiben in eine Access accdb --------
$s_db_pwd = "12345678"
_access_write()
Func _access_write()
$s_dbname = "D:\TestDB.accdb"
$datenbankpfad = $s_dbname
$s_data01 = @username
$s_data02 = @ComputerName
$adoCon = ObjCreate("ADODB.Connection")
$adoCon.Open("Provider=Microsoft.ACE.OLEDB.12.0; Jet OLEDB:Database Password=" & $s_db_pwd & "; Data Source=" & $datenbankpfad & ";")
$adoRs = ObjCreate("ADODB.Recordset")
;$adoRs.CursorType = 1
;$adoRs.LockType = 3
Local $sQuery = "INSERT INTO TB1 (`feld1`,`feld2`)" & _
"VALUES ('" & $s_data01 & "',"& _ ;User
"'" & $s_data02 & "')" ;PC
$adoCon.Execute($sQuery)
$adoCon.Close
EndFunc
;-------- update auf eine access accdb ----------
_access_write_update()
Func _access_write_update()
$dbname = "D:\Data\scripte\MS_AccessCom\access_01\db_test.accdb"
$tblname = "epayslip"
$s_data07 = _Now()
$FULL_MDB_FILE_NAME = $dbname
;$SQL_CODE = "select * from epayslip"
$CONN = ObjCreate("ADODB.Connection")
;$CONN.Open('Driver={Microsoft Access Driver (*.mdb)};Dbq=' & $FULL_MDB_FILE_NAME & ';')
$CONN.Open("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & $FULL_MDB_FILE_NAME & ";")
$RecordSet = ObjCreate("ADODB.Recordset")
;Local $sQuery = "UPDATE " & $tblname & " SET check = 1, date = " & $s_data07 & " WHERE user = " & "'" & @UserName & "'"
Local $sQuery = "UPDATE " & $tblname & " SET " & $tblname & ".[check] = 1, " & $tblname & ".[date] = '" & $s_data07 & "' WHERE " & $tblname & ".[user] = " & "'" & @UserName & "'"
;ConsoleWrite($sQuery)
$CONN.Execute($sQuery)
$CONN.Close
EndFunc
Alles anzeigen
gruß gmmg
schau mal hier, ob da was passendes zu finden ist
http://support.dameware.com/kb/article.aspx?ID=400113
http://forums.dameware.com/viewtopic.php?f=8&t=59
Complete the following procedures according to your deployment scenario.
To install DRS or MRC using the MSI installer and a valid license:
Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
msiexec /i fileName.msi /qn APPDIR="C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=1 SA_KEY=licenseKey SA_EMAIL=emailAddress SA_FIRST_NAME=firstName SA_LAST_NAME=lastNema /l*+ %temp%\install.log
To install DRS or MRC using the EXE installer and a valid license:
Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
fileName.exe /args "/qn APPDIR=\"C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=1 SA_KEY=licenseKey SA_EMAIL=emailAddress SA_FIRST_NAME=firstName SA_LAST_NAME=lastName /L*V %temp%\Install.log"
To install DRS or MRC using the MSI installer in evaluation mode:
Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
msiexec /i fileName.msi /qn APPDIR="C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=1 /L*V %temp%\Install.log
To install DRS or MRC using the EXE installer in evaluation mode:
Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
fileName.exe /args "/qn APPDIR=\"C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=1 /L*V %temp%\Install.log"
To install DRS or MRC using the MSI installer in centralized mode:
Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
msiexec /i fileName.msi /qn APPDIR="C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=0 CENTRALSERVERHOSTNAME=CentralServerHostName CENTRALSERVERPORT=portNumber CSUSER=userName CSPASSWORD=userPassword /L*V %temp%\Install.log
To install DRS or MRC using the EXE installer in centralized mode:
Use the following command at the command line or in an installer script. Replace the variables in this example according to the values in the Arguments section.
fileName.exe /args "/qn APPDIR=\"C:\Program Files\DameWare programName\" reboot=reallysuppress SILENT=yes INSTALLSTANDALONE=0 CENTRALSERVERHOSTNAME=CentralServerHostName CENTRALSERVERPORT=portNumber CSUSER=userName /L*V %temp%\Install.log"
Arguments
The following define the arguments used in the commands in this article.
The following arguments are included in version 10.0:
gruß gmmg
hallo,
am besten du benutzt das MSI paket von Dameware ...Wir benutzen noch die DNTU7x.msi (msiexec /i "Pfad zur msi\DNTU7x.msi" /qn /norestart)
Wenn du nur die Exe hast, probiere mal in der CMD Dameware.exe /? und schau ob da die Parameter angezeigt werden.
Beispiel ungetestet ...
RunAs($ADMINUSER, $DOMAIN, $ADMINPASS, 0, @comspec & " /c " & "msiexec /i c:\temp\DNTU7x.msi /qn /norestart")
Gruß gmmg