Dizzy Posted September 5, 2006 Share Posted September 5, 2006 Hi!In the console of scite i get this entry : not IsArray($ar_array) and StringInStr($ar_array,|)>0Its no error or warning - so what is it?The action (_AddRecord) works fine.CUDizzy Link to comment Share on other sites More sharing options...
randallc Posted September 5, 2006 Share Posted September 5, 2006 (edited) Hi, Just a debug line i forgot to eliminate...[PS reminds me .. you can add the new record line from an array instead of a string] Later, Randall Edited September 5, 2006 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Dizzy Posted September 7, 2006 Share Posted September 7, 2006 Hi Randall,i've played a little bit around the array - but i get errors if i use :$s_Row = _ArrayCreate("col2","262","26/12/2006")If i create a array with 4 args it works fine.$s_Row = _ArrayCreate("x","col2","262","26/12/2006")What's the first statement for?GreetsDizzy Link to comment Share on other sites More sharing options...
randallc Posted September 7, 2006 Share Posted September 7, 2006 Hi, It is always hard to predict in AutoIt how people will make their arrays; it is ambiguous. Traditionallly, and I have stuck with it here at present, AutoIt uses the first element as the array count (ubound($ar_Array)-1). eg in HelpFile, 1. StringSplit creates $array[0] as counter element "Returns an array, the first element ($array[0]) contains the number of strings returned, the remaining elements ($array[1], $array[2], etc.) contain the delimited strings." 2. _FileListToArray "$array[0] = Number of Files\Folders returned" 3. _DateTimeSplit; $asDatePart "array that contains the Date. $asDatePart[0] number of values returned" 4. _DateTimeSplit;$asTimePart, array that contains the Time. $asTimePart[0] number of values returned" 5. _GUICtrlTabGetItemRECT; Array containing the RECT, first element ($array[0]) contains the number of elements" 6. etc forever.......... "_ArrayCreate" does NOT! You can't win.... Best, randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
randallc Posted September 8, 2006 Share Posted September 8, 2006 PS ;ghArray.au3 #include<array.au3> local $s_Row[3] = ["col2","262","26/12/2006"] _ArrayDisplay($s_Row,"$s_Row")Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Dizzy Posted September 12, 2006 Share Posted September 12, 2006 Thanks for teaching! :"> Link to comment Share on other sites More sharing options...
blitzkrg Posted September 22, 2006 Share Posted September 22, 2006 how do you add data to a specific record? lets say i have and address book record 3 has name, addres, but no phone number, how do it tell it to go to that specific record and update that field. from the examples, it seems as it can only add data after number 5 (whatever is the last line in the database) Link to comment Share on other sites More sharing options...
ptrex Posted September 22, 2006 Share Posted September 22, 2006 @blitzkrgYou will need to use an UPDATE query.Start reading this SQL TutorialHope this helps.regardsptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
blitzkrg Posted September 22, 2006 Share Posted September 22, 2006 @blitzkrgYou will need to use an UPDATE query.Start reading this SQL TutorialHope this helps.regardsptrexYeah i just figured out i had to use the _ExecuteMDB function with an UPDATE queryI was trying to use the _addrecord fucntioni came back to nuke my post since i figured it out but you got here first..thanks for the tip though Link to comment Share on other sites More sharing options...
NeptuneIT Posted November 2, 2006 Share Posted November 2, 2006 I'm using the AccessCom script and it is amazing. I really appreciate all the work on this. I've got my script working where I can write to the database just fine. My problem comes in when I want to read from the database. Is there a way to save each value of each field to a different variable? I've used the code $query = "SELECT * FROM " & $s_Tablename & " WHERE " & $Fieldname5 & " = " & False $strData = _ReadOneField ($query, $s_dbname, $Fieldname1, $o_Con) This returns the data I want but everything is in one string. I'd like to manipulate each record and then do an UPDATE query. The only way I know to do this is to save each field in each record to their own variables. Any ideas? Link to comment Share on other sites More sharing options...
randallc Posted November 3, 2006 Share Posted November 3, 2006 Hi, Not sure what you mean; Will it be easy if they are in an array first? $a_array=StringSplit($strData,@CRLF,1) _ArrayDelete($a_array,UBound($a_array)-1) _ArrayDisplay($a_array,"$a_array")Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now