Jump to content

BryanVest

Active Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by BryanVest

  1. That worked and shows each value in the Msgbox now how would I get that into an array? EDIT: Nevermind I got it Thanks for the help. Final code: $dbname = "p:Pallet TagPallet Tracking_be.accdb" $query = "SELECT PalletCreate.PalletID FROM PalletCreate LEFT JOIN PalletTruck ON PalletCreate.[PalletID] = PalletTruck.[PalletID] WHERE (((PalletTruck.PalletID) Is Null))" Local $title $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open ("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & $dbname) $adoRs = ObjCreate ("ADODB.Recordset") $adoRs.CursorType = 1 $adoRs.LockType = 3 $adoRs.Open ($query, $adoCon) $cnt = 0 Local $list[1] While Not $adoRS.EOF $cnt += 1 _ArrayAdd($list, $adoRs.Fields("PalletID").value) $adoRS.MoveNext WEnd $adoCon. GuiCtrlSetData($List1, _ArrayToString($list))
  2. I have been retrieving values from MSACCESS databases using the guide on this site. http://vista.tutorialref.com/autoit/autoit-access-database.html I have modified it a bit to work with accdb's, but it still works. Currently though it only returns one result. Anyone know how to make it show the 3-4 that it should return by the query in an array? Code: $dbname = "p:\Pallet Tag\Pallet Tracking_be.accdb" $query = "SELECT PalletCreate.PalletID FROM PalletCreate LEFT JOIN PalletTruck ON PalletCreate.[PalletID] = PalletTruck.[PalletID] WHERE (((PalletTruck.PalletID) Is Null))" Local $title $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open ("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & $dbname) $adoRs = ObjCreate ("ADODB.Recordset") $adoRs.CursorType = 1 $adoRs.LockType = 3 $adoRs.Open ($query, $adoCon) $title = $adoRs.Fields("PalletID").value MsgBox(0,"testing",$title) EndSwitch
  3. Basically I have a readout program using a function I made to retrieve SNMP information for our printers to get toner and page counts. This loops every 3 seconds. I have another function that i would like to loop every 30 minutes to record the counts to an access database. I basically need the SNMP function running to update my GUI every 3 seconds and another runnning every 30 minutes at the same time.
  4. A check box next to every item I dont think is possible within a combobox, but to populate the options do this. $hCombo = GUICtrlCreateCombo("OPTION1|OPTION2|OPTION3", 122, 138, 145, 25)
  5. Is it possible to have your script be running 2 loops simultaniously? I need one fuction to run every 10 seconds and another to run every 30 minutes.
  6. Nevermind figured it out myself. Added the filepath as a variable and it worked. While 1 $filepath = "C:Documents and SettingsTruckSystemDesktopTrailerTrailer Status Log.xlsx" $oExcel = _ExcelBookOpen($filepath, 0) $aArray = _ExcelReadSheetToArrayEx($oExcel) GUICtrlSetData($carspace1,$aArray[4][1]) Sleep(60000) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
  7. I cant seem to figure out this one as the error is with Excel.udf it seems. Error: C:Program FilesAutoIt3IncludeExcel.au3 (191) : ==> The requested action with this object has failed.: If $sPassword = "" And $sWritePassword = "" Then .WorkBooks.Open($sFilePath, Default, $fReadOnly) If $sPassword = "" And $sWritePassword = "" Then .WorkBooks.Open($sFilePath, Default, $fReadOnly)^ ERROR ->15:46:51 AutoIT3.exe ended.rc:1 Code: While 1 $oExcel = _ExcelBookOpen("C:Documents and SettingsTruckSystemDesktopTrailerTrailer Status Log.xlsx", 0) $aArray = _ExcelReadSheetToArrayEx($oExcel) GUICtrlSetData($carspace1,$aArray[4][1]) Sleep(60000) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ; #FUNCTION# ==================================================================================================================== ; Name...........: _ExcelReadSheetToArrayEx ; Description ...: Create a 2D array from the rows/columns of the active worksheet. ; Syntax.........: _ExcelReadSheetToArray($oExcel[, $iStartRow = 1[, $iStartColumn = 1[, $iRowCnt = 0[, $iColCnt = 0]]]]) ; Parameters ....: $oExcel - Excel object opened by a preceding call to _ExcelBookOpen() or _ExcelBookNew() ; $iStartRow - Row number to start reading, defaults to 1 (first row) ; $iStartColumn - Column number to start reading, defaults to 1 (first column) ; $iRowCnt - Count of rows to read, defaults to 0 (all) ; $iColCnt - Count of columns to read, defaults to 0 (all) ; Return values .: Success - Returns a 2D array with the specified cell contents by [$row][$col] ; Failure - Returns 0 and sets @error on errors: ; |@error=1 - Specified object does not exist ; |@error=2 - Start parameter out of range ; |@extended=0 - Row out of range ; |@extended=1 - Column out of range ; |@error=3 - Count parameter out of range ; |@extended=0 - Row count out of range ; |@extended=1 - Column count out of range ; Modified.......: litlmike (added Column shift parameter to Start Array Column on 0) and PsaltyDS 01/04/08 - 2D version _ExcelReadSheetToArray() ; Remarks .......: Returned array has row count in [0][0] and column count in [0][1]. ; Except for the counts above, row 0 and col 0 of the returned array are empty, as actual ; cell data starts at [1][1] to match R1C1 numbers. ; By default the entire sheet is returned. ; If the sheet is empty [0][0] and [0][1] both = 0. ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _ExcelReadSheetToArrayEx($oExcel, $iStartRow = 1, $iStartColumn = 1, $iRowCnt = 0, $iColCnt = 0) Local $avRET[1][2] = [[0, 0]] ; 2D return array ; Test inputs If Not IsObj($oExcel) Then Return SetError(1, 0, 0) If $iStartRow < 1 Then Return SetError(2, 0, 0) If $iStartColumn < 1 Then Return SetError(2, 1, 0) If $iRowCnt < 0 Then Return SetError(3, 0, 0) If $iColCnt < 0 Then Return SetError(3, 1, 0); Get size of current sheet as R1C1 string ; Note: $xlCellTypeLastCell and $x1R1C1 are constants declared in ExcelCOM_UDF.au3 Local $sLastCell = $oExcel.Application.Selection.SpecialCells($xlCellTypeLastCell).Address(True, True, $xlR1C1) ; Extract integer last row and col $sLastCell = StringRegExp($sLastCell, "(d+)", 3) Local $iLastRow = $sLastCell[0] Local $iLastColumn = $sLastCell[1]; Return 0's if the sheet is blank If $sLastCell = "R1C1" And $oExcel.Activesheet.Cells($iLastRow, $iLastColumn).Value = "" Then Return $avRET ; Check input range is in bounds If $iStartRow > $iLastRow Then Return SetError(2, 0, 0) If $iStartColumn > $iLastColumn Then Return SetError(2, 1, 0) If $iStartRow + $iRowCnt - 1 > $iLastRow Then Return SetError(3, 0, 0) If $iStartColumn + $iColCnt - 1 > $iLastColumn Then Return SetError(3, 1, 0); Check for defaulted counts If $iRowCnt = 0 Then $iRowCnt = Number($iLastRow) If $iColCnt = 0 Then $iColCnt = Number($iLastColumn) ;Read data Local $aArray = $oExcel.ActiveSheet.Range($oExcel.Cells($iStartRow, $iStartColumn), $oExcel.Cells($iRowCnt, $iColCnt)).Value Dim $avRET[UBound($aArray, 2) + 1][UBound($aArray)] = [[UBound($aArray, 2), UBound($aArray)]] ;Declare Array again and set row and col count For $i = 0 To UBound($aArray, 1) - 1 For $j = 0 To UBound($aArray, 2) - 1 $avRET[$j + 1][$i] = $aArray[$i][$j] Next Next Return $avRET EndFunc ;==>_ExcelReadSheetToArrayEx
  8. Very true a 3 second delay works great for this and honestly it seems instantly.
  9. Yep that was it I was hoping I could keep it real time, but added a 3 second delay and it works perfectly. Thanks!
  10. Hello I created a script that monitors all the copiers on my network and then displays the current counter in real time. However after about 15-30 seconds the script stops updating. Any ideas why? Code: #include <string.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Aseptic Solutions Copier Count", 369, 370, 356, 265) $Label1 = GUICtrlCreateLabel("484 Downstairs:", 40, 32, 154, 26) GUICtrlSetFont(-1, 14, 800, 0, "Arial") $Label2 = GUICtrlCreateLabel("484 Upstairs:", 69, 120, 126, 26) GUICtrlSetFont(-1, 14, 800, 0, "Arial") $Label3 = GUICtrlCreateLabel("536:", 144, 197, 44, 26) GUICtrlSetFont(-1, 14, 800, 0, "Arial") $Label4 = GUICtrlCreateLabel("458:", 144, 275, 44, 26) GUICtrlSetFont(-1, 14, 800, 0, "Arial") $Label5 = GUICtrlCreateLabel("RICOH Aficio MP 4002", 40, 56, 141, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Label6 = GUICtrlCreateLabel("10.1.188.79", 41, 73, 72, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Label7 = GUICtrlCreateLabel("RICOH Aficio MP C4501", 46, 143, 150, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Label8 = GUICtrlCreateLabel("10.1.188.82", 47, 160, 72, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Label9 = GUICtrlCreateLabel("LANIER MP 4000/LD040", 35, 220, 149, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Label10 = GUICtrlCreateLabel("", 36, 237, 4, 4) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Label11 = GUICtrlCreateLabel("10.1.188.81", 35, 237, 72, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Label12 = GUICtrlCreateLabel("RICOH Aficio MP 2851", 48, 298, 141, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Label13 = GUICtrlCreateLabel("10.1.188.80", 48, 315, 72, 20) GUICtrlSetFont(-1, 10, 800, 0, "Arial") $Label14 = GUICtrlCreateLabel("0", 208, 32, 129, 33, $SS_RIGHT) GUICtrlSetFont(-1, 18, 800, 0, "Arial") GUICtrlSetColor(-1, 0x008000) $Label15 = GUICtrlCreateLabel("0", 208, 114, 129, 33, $SS_RIGHT) GUICtrlSetFont(-1, 18, 800, 0, "Arial") GUICtrlSetColor(-1, 0x008000) $Label16 = GUICtrlCreateLabel("0", 200, 195, 137, 33, $SS_RIGHT) GUICtrlSetFont(-1, 18, 800, 0, "Arial") GUICtrlSetColor(-1, 0x008000) $Label17 = GUICtrlCreateLabel("0", 208, 277, 129, 33, $SS_RIGHT) GUICtrlSetFont(-1, 18, 800, 0, "Arial") GUICtrlSetColor(-1, 0x008000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Dim $IP_ADDRESS $IP_ADDRESS = "10.1.188.79" $IP_ADDRESS2 = "10.1.188.80" $IP_ADDRESS3 = "10.1.188.81" $IP_ADDRESS4 = "10.1.188.82" $PORT = "161" $Count = "0x302C02010104067075626C6963A01F0202000102010002010030133011060C2B060102012B0A0201040101050100" $Count1 = "0x302C02010104067075626C6963A01F0202000102010002010030133011060C2B060102012B0A0201040101050100" $CountMax = 5 $result_count=getsnmp($IP_ADDRESS,$Count,$CountMax) $result_count2=getsnmp($IP_ADDRESS2,$Count1,$CountMax) $result_count3=getsnmp($IP_ADDRESS3,$Count,$CountMax) $result_count4=getsnmp($IP_ADDRESS4,$Count,$CountMax) GUICtrlSetData($Label14,$result_count) GUICtrlSetData($Label17,$result_count2) GUICtrlSetData($Label16,$result_count3) GUICtrlSetData($Label15,$result_count4) Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Dim $IP_ADDRESS $IP_ADDRESS = "10.1.188.79" $IP_ADDRESS2 = "10.1.188.80" $IP_ADDRESS3 = "10.1.188.81" $IP_ADDRESS4 = "10.1.188.82" $PORT = "161" $Count = "0x302C02010104067075626C6963A01F0202000102010002010030133011060C2B060102012B0A0201040101050100" $Count1 = "0x302C02010104067075626C6963A01F0202000102010002010030133011060C2B060102012B0A0201040101050100" $CountMax = 5 $result_count=getsnmp($IP_ADDRESS,$Count,$CountMax) $result_count2=getsnmp($IP_ADDRESS2,$Count1,$CountMax) $result_count3=getsnmp($IP_ADDRESS3,$Count,$CountMax) $result_count4=getsnmp($IP_ADDRESS4,$Count,$CountMax) MsgBox(1,"",$result_count & " " & $result_count2 & " " & $result_count3 & " " & $result_count4) Func getsnmp($IP_ADDRESS,$CMD,$MAXRESULT) UDPStartUp() $Start = 1 $Socket = UDPopen($IP_ADDRESS, $Port) UDPSend($Socket, $CMD) While (1) $srcv = UDPRecv($Socket, 2048) If ($srcv <> "") Then $result_getsnmp=Dec(stringright($srcv,$MAXRESULT)) Return $result_getsnmp ExitLoop EndIf sleep(100) WEnd UDPCloseSocket($Socket) UDPShutdown() EndFunc
  11. Strange when I change it to that I only see my own computer. I have about 85 online right now though. EDIT: Nevermind now it is working now! Thank you!
  12. Here is the full code. Please let me know if you can make any sense of what is going on. It worked 1 time for me and now it just errors out. I have spent like 45 minutes trying to figure this out, but I am stuck. Thank you for your help so far. #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:Documents and SettingsbvestDesktopkoda_1.7.3.0Formssd.kxf $Form1 = GUICreate("Symantec Uninstall Tool", 475, 168, 225, 231) $Label1 = GUICtrlCreateLabel("Computer Name:", 24, 16, 122, 22) GUICtrlSetFont(-1, 11, 800, 0, "Arial") $Label2 = GUICtrlCreateLabel("Uninstall Command:", 27, 61, 144, 22) GUICtrlSetFont(-1, 11, 800, 0, "Arial") $Button1 = GUICtrlCreateButton("Refresh", 16, 104, 75, 49) $Input2 = GUICtrlCreateInput("", 176, 64, 281, 21) GUICtrlSetFont(-1, 1, 400, 0, "MS Sans Serif") $Button3 = GUICtrlCreateButton("Remove", 384, 104, 73, 49) $Combo1 = GUICtrlCreateCombo("", 152, 16, 193, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Button2 = GUICtrlCreateButton("Get Uninstall String", 360, 16, 105, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Func _ListComputers() Local $rArray, $Buff, $Pid = Run(@ComSpec & ' /c net view', '', @SW_HIDE, 6) While Not @error $buff &= StdoutRead($Pid) WEnd $rArray = StringRegExp($Buff, "[]+([w-]+)", 3) If @Error Then $rArray = StringRegExp(@ComputerName, "(.+)", 1) Return $rArray EndFunc $aComputers = _ListComputers() If IsArray($aComputers) Then $sData = "" For $i = 0 To Ubound($aComputers) -1 $sData &= $aComputers[$i] & "|" Next Else Endif GuiCtrlSetData($Combo1,StringTrimRight($sData, 1), $aComputers[1]) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 $Name = GUICtrlRead($Combo1) $sRegKey = "" & $Name &"HKLMSOFTWAREMicrosoftWindowsCurrentVersionUninstall" $iKey = 1 While 1 $sHold = RegEnumKey($sRegKey, $iKey) If @Error Then ExitLoop $iKey += 1 IF RegRead($sRegKey & $sHold, "DisplayName") = 'Symantec Endpoint Protection' Then $sCur_Val = RegRead($sRegKey & $sHold, "UninstallString") If NOT @Error Then GUICtrlSetData($Input2,$sCur_Val) ExitLoop EndIf EndIf WEnd EndSwitch WEnd This code is for a tool to pull the unistall string from a remote computer, but I wanted to have it query the network using "net view" to bring up online computers. This is the part that errors test.au3 (40) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: GuiCtrlSetData($Combo1,StringTrimRight($sData, 1), $aComputers[1]) GuiCtrlSetData($Combo1,StringTrimRight($sData, 1), ^ ERROR However, if I change it to GuiCtrlSetData($Combo1,StringTrimRight($sData, 1), $aComputers[0]) it pulls my computer name only.
  13. So what I seem to have found out is that GuiCtrlSetData($Combo1, StringTrimRight($sData, 1), $aComputers[1]) causes the error. Any idea why?
  14. Can anyone please help me. The following code worked the first time, but errors out now. Any ideas why? Error: test.au3 (37) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: Code: Func _ListComputers() Local $rArray, $Buff, $Pid = Run(@ComSpec & ' /c net view', '', @SW_HIDE, 6) While Not @error $buff &= StdoutRead($Pid) WEnd $rArray = StringRegExp($Buff, "[]+([w-]+)", 3) If @Error Then $rArray = StringRegExp(@ComputerName, "(.+)", 1) Return $rArray EndFunc $aComputers = _ListComputers() $sData = "" For $i = 0 To Ubound($aComputers) -1 $sData &= $aComputers[$i] & "|" Next GuiCtrlSetData($Combo1, StringTrimRight($sData, 1), $aComputers[1])
  15. Nevermind I was able to figure it out. Thank you for letting me know what functions to use $palletfile = FileOpen("c:palletnum.txt",0) $palletnum = FileReadLine($palletfile) FileClose($palletfile) $palletread = StringRegExp($palletnum, '([0-9]{7})', 1) $oldpallet = $palletread[0] $newpallet = $oldpallet +1 $formatpallet = StringFormat("%07i", $newpallet) FileOpen("C:palletnum.txt",2) FileWrite($palletfile,$formatpallet) FileClose($palletfile) Msgbox(-1,"",$formatpallet)
  16. Would you have an example of such? Sorry, I have never used StringRegExp before and the help files a little confusing.
  17. I am working on a script that prints a sticker with the number. I need this serialized so I am looking to have it open the text file with read access, read the line into variable $palletnum then close the text file. Then add a 1 to the end of whats in $palletnum. The only problem is I have a letter in the front so it doesnt see how to add and just replaces the whole thing with 1. Is there a way to add to the number part and not the A in the front? The other way I can have it is to have the printing software I will be passing the number to add an A to the front(very easy), but I need the number to be 7 digits. Right now I have 0000001 in the file and when it adds 1 it just makes it 2. Is there a way to have it keep the 0's? Code: $palletfile = FileOpen("c:\palletnum.txt",0) $palletnum = FileReadLine($palletfile) FileClose($palletfile) $palletnew = $palletnum + 1 FileOpen("C:\palletnum.txt",2) FileWrite($palletfile,$palletnew) FileClose($palletfile) Msgbox(-1,"",$palletnum)
  18. I figured it out Changed $adoRS.Execute ($sql) To $adoCon.Execute ($sql) and everything imported perfectly. Thank you!
  19. Yeah I had them without originally, but I added them when I saw the brackets on some other site. I still have the same error.
  20. Same error though even with the suggested changes. Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 $PalletID = GUICtrlRead($Input1) $Product = GUICtrlRead($Combo2) $Lot = GUICtrlRead($Input2) $Country = GUICtrlRead($Input3) $Expire = GUICtrlRead($Date1) $Quantity = GUICtrlRead($Input4) $dbname = "p:Pallet TagPallet Tracking_be.accdb" $tblname = "NJ" $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open ("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & $dbname) $adoRs = ObjCreate ("ADODB.Recordset") $adoRs.CursorType = 3 $sql = "INSERT INTO NJ ([PalletID], [LOTNumber], [ProductID], [ExpirationDate], [Quantity], [Customer], [CreatedTime], [CreatedDate],[Country])" & " VALUES ('" & $PalletID & "','" & $Lot & "')" $adoRS.Execute ($sql) EndSwitch WEnd ; Your code goes here Func _ErrFunc($oError) MsgBox(0, "COM error", "err.number is: " & @TAB & $oError.number & @CRLF & _ "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ "err.description is: " & @TAB & $oError.description & @CRLF & _ "err.source is: " & @TAB & $oError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ "err.retcode is: " & @TAB & $oError.retcode & @CRLF & @CRLF) EndFunc ;==>_ErrFunc
  21. This is where I am at now. While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") ; Your code goes here Func _ErrFunc($oError) MsgBox(0, "COM error", "err.number is: " & @TAB & $oError.number & @CRLF & _ "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ "err.description is: " & @TAB & $oError.description & @CRLF & _ "err.source is: " & @TAB & $oError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ "err.retcode is: " & @TAB & $oError.retcode & @CRLF & @CRLF) EndFunc ;==>_ErrFunc $PalletID = GUICtrlRead($Input1) $Product = GUICtrlRead($Combo2) $Lot = GUICtrlRead($Input2) $Country = GUICtrlRead($Input3) $Expire = GUICtrlRead($Date1) $Quantity = GUICtrlRead($Input4) $dbname = "p:Pallet TagPallet Tracking_be.accdb" $tblname = "Naked Juice" $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open ("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & $dbname) $adoRs = ObjCreate ("ADODB.Recordset") $adoRs.CursorType = 3 $sql = "INSERT INTO NJ ([PalletID], [LOTNumber], [ProductID], [ExpirationDate], [Quantity], [Customer], [CreatedTime], [CreatedDate],[Country])" & " VALUES ('" & $PalletID & "','" & $Lot & "')" $adoRS.Execute $sql EndSwitch WEnd The error with the handler is -2147352570 and the description is Unknown Name. The error line is $adoRS.Execute $sql
  22. I have a database built in MS Access 2007. I am trying to import the data from the GUI to access as a new record and cant seem to find the answer anywhere. Heres what I have. Case $Button2 $PalletID = GUICtrlRead($Input1) $Product = GUICtrlRead($Combo2) $Lot = GUICtrlRead($Input2) $Country = GUICtrlRead($Input3) $Expire = GUICtrlRead($Date1) $Quantity = GUICtrlRead($Input4) $dbname = "p:\Pallet Tag\Pallet Tracking_be.accdb" $tblname = "Naked Juice" $query = "INSERT INTO 'Naked Juice' (*) VALUES ('Test')" $adoCon = ObjCreate("ADODB.Connection") $adoCon.Open ("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & $dbname) $adoRs = ObjCreate ("ADODB.Recordset") $adoRs.CursorType = 1 $adoRs.LockType = 3 $adoRs.Open ($query, $adoCon) I get the following error. I seem like I connect to the database alright but cant seem to add a record. Pallet Creator.au3 (65) : ==> The requested action with this object has failed.: $adoRs.Open ($query, $adoCon) $adoRs.Open ($query, $adoCon)^ ERROR
  23. Yeah I am able to download it with no issue. However I changed this to using wget and it worked without issue.
  24. Hmmmm works at home, but still error 13 on the network.
  25. I have been searching, but I couldnt find anything with a real solution posted. Any advice?
×
×
  • Create New...