Raestlin Posted May 23, 2006 Posted May 23, 2006 (edited) I have created an entirely new database code that does not require ODBC connections. I have re-worked the code since this original post, so see my last post for the updates {new code in my last post} Here's what you need to change: 1) Use ONE of the two "Dim $query" commands (depending on whether you are using a text file or not). 2) Change the "Dim $query" command to equal whatever query statement you need. 3) Use ONE of the five "Dim $DSN" command (depending on what database type you are connecting to). Modifications I made: 1) I removed the need for ODBC connections. 2) I removed the prompt for the query command, since you will hard code this anyways in most cases. 3) I removed the popup telling you how many records were retrieved. Instead, the window title shows you. 4) I commented the code to make it easy to understand. 5) I completely re-wrote the code to be more dynamic and to be used as a UDF now. Edited May 25, 2006 by Raestlin
blitzkrg Posted May 23, 2006 Posted May 23, 2006 (edited) Thats great.. Any plans create a function so you can write to those databases? Edited May 23, 2006 by blitzkrg
Raestlin Posted May 23, 2006 Author Posted May 23, 2006 Thats great.. Any plans create a function so you can write to those databases?If others are interested, I will create a full-fledged code with add/update/modify, delete, etc.It may take me a couple days, but the connector is the hardest part.Once the connector is in place, the other code is the same for everything.I'll look into it and create a GUI for it as well.
ptrex Posted May 24, 2006 Posted May 24, 2006 @Raestlin I am if favour of expanding the code to more functiosn. If you are interested in creating a GUI to a look in my Signature at the SQLite_Gui example. This might inspire you. Regards 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
blitzkrg Posted May 24, 2006 Posted May 24, 2006 for me i'm mostly interested in a read/write UDF i would like to be able to read and write to specific rows also some of the other UDF's could own write to the last row
Raestlin Posted May 24, 2006 Author Posted May 24, 2006 for me i'm mostly interested in a read/write UDFi would like to be able to read and write to specific rows alsosome of the other UDF's could own write to the last rowOK, I'm currently in the process of completely re-writing the code.I'm extremely anal about my coding and I saw way too much wrong with theprevious person's code that I initially started with. It was good, but not good enoughfor me. You'll understand when you see my new code how anal I am.I like things to be more dynamic.I'm creating it to be more of an "include.au3" code (I'm guessing that's what you all consider a UDF?).I am also creating a GUI wrapper around the code for example purposes.It's going to take me longer than the initial few days I mentioned since I'm completelyre-writing everything. I will post it once I have a working beta and then I can addmodifications once it's in beta.First round, I will include display, write, and delete of records.
Raestlin Posted May 25, 2006 Author Posted May 25, 2006 First round, I will include display, write, and delete of records. OK, I wanted to get my base code up to all you guys since I done with a new UDF version of the database code. It currently only displays records, but what do you expect after only one day of a complete re-write?? :-) LOL I cleaned up a lot of the code, but there's not any error checking just yet. That is still to come as well as writing and deleting records. I'm attaching a zip file with the UDF and example code. Database.zip The "Database.au3" is the UDF that needs to go in your AutoIt include folder. The "ADODB_Gui2.au3" is the sample GUI wrapper. The "test.mdb" is the sample database that has bogus data in it. Make sure that the access .mdb file is in the same folder as the GUI wrapper before it will run.
tonedeaf Posted May 25, 2006 Posted May 25, 2006 @Raestlin Your script was very useful. It saved me a lot of time figuring out the database connections. Thanks for the working example.
piccaso Posted May 25, 2006 Posted May 25, 2006 (edited) nice i needed something like this ... Edited May 25, 2006 by piccaso CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Raestlin Posted May 25, 2006 Author Posted May 25, 2006 nice i needed something like this ...Thanks. :-)Check back later and I will have more added to the UDF that will includewriting and deleting records.
Walkabout Posted June 8, 2006 Posted June 8, 2006 (edited) 3) Use ONE of the five "Dim $DSN" command (depending on what database type you are connecting to).Fantastic Post Raestlin.I've been struggling with trying to connect to an AS400 database without resorting to ODBC for a long time now, and had no success. How did you determine what the DSN connect strings should be, and maybe I can add another one?ThanksWalkabout Edited June 8, 2006 by Walkabout My Stuff:AutoIt for the MassesWait until Oracle Apps is readySend email natively from Autoit3
ptrex Posted June 8, 2006 Posted June 8, 2006 @WalkaboutMaybe this can help you out.DNS Less Connection StringEnjoy !! 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
Walkabout Posted June 13, 2006 Posted June 13, 2006 @WalkaboutMaybe this can help you out.DNS Less Connection StringEnjoy !!Thanks Ptrex. You've made me a very happy scripter!!!!!Walkabout My Stuff:AutoIt for the MassesWait until Oracle Apps is readySend email natively from Autoit3
Raestlin Posted June 13, 2006 Author Posted June 13, 2006 OK, been a while. Not allowed to script at work any more. Been learning VB at work and can only script at home now. Here's my latest addition to the UDF. You can now delete records. I've attached my sample GUI as well that I've been working on. Future changes: * Function to update records * Function (wizard) to help you build query string * Function (wizard) to help you build connection string Database UDF and Sample GUI: {zip file} database.zip
Laetterman Posted June 28, 2006 Posted June 28, 2006 hi Raestlin, nice au3.function, it works fine for me!!! Do you update the UDF with a function for adding/updating of records ? mfg, Laetterman
JackB Posted June 29, 2006 Posted June 29, 2006 Nice Raestlin. Gets me going again, I had hit a snag with .mdb files. This got me going again. Would love to see functions for sorting, adding and modifying records. Thanks.
fong1sky Posted July 22, 2006 Posted July 22, 2006 If my query is not found. I get this errorLine 70 (File "C:\Program Files\AutoIt3\beta\Include\Database.au3"):graphic 722 $aRsData = .GetRows(-1)$aRsData = .GetRows(-1)^ ERRORError: Error in expression.Can anyone tell me how can I solve it?Thank you
randallc Posted July 22, 2006 Posted July 22, 2006 Hi, I guess you can read your query first, and only call the readdata if the query has returned something...? don't, know, haven't tested it.. Best, Randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
Pa Callender Posted September 15, 2006 Posted September 15, 2006 (edited) Hi RaestlinThese functions are awesome. I was in a mess trying to create my useless scripts (latest project is a UK-style secondary school register system that mimics SIMS Lesson Monitor, but also has a Staff Chat option for requesting support, photocopies, etc.), but I could not get my head round my 250+ INI files to register Pupils, Classes, Teachers, Lessons, Timetables, Etc. - My INIRead functions went everywhere. Now with Database functions, and the in-built TCPIP networking functions, I can create this idea:THEORY======APP Login > TCP the server to check if user is validIF YES - TCP the server > Server return query using database vars > Send back to App > Copy into local database > Do whatever > Logout > Send database data back over TCP > Server copy into master databaseIF NO - Close AppI'll write an _UpdateData UDF for inclusion.Thanks, P. CallenderEDIT: Damn it, using Rich Edit features mean all line breaks are doubled (like @CR&@LF&@CR&@LF) for some reason. Edited September 15, 2006 by Pa Callender [size="4"]YOU SHALL NOT PARSE!![/size]
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