zfisherdrums Posted November 27, 2007 Share Posted November 27, 2007 (edited) All,According to this, I need to pass an equivalent to 'Nothing' into the ActiveConnection method of the RecordSet object. However, I'm having difficulty sending the proper parameter. Does anyone have any idea how to implement disconnected recordsets via AutoIt?CODE; ADO ConstantsGlobal Const $ADOPENSTATIC = 3 Global Const $ADUSECLIENT = 3Global Const $ADOPENFORWARDONLY = 0Global Const $ADLOCKBATCHOPTIMISTIC = 4 ; Open ADO DB ConnectionDim $sPath = "c:\temp_database.xls"Dim $objConnection = ObjCreate( "ADODB.Connection" ) $objConnection.Provider = "Microsoft.Jet.OLEDB.4.0"$objConnection.ConnectionString = 'Data Source="' & $sPath & '"; Extended Properties=Excel 8.0;'$objConnection.Open ; Fill the RecordsetDim $objRecordSet = ObjCreate( "ADODB.Recordset" )Dim $strQuery = "SELECT * FROM Input"$objRecordSet.CursorLocation = $ADUSECLIENT$objRecordSet.Open( $strQuery, $objConnection, $ADOPENFORWARDONLY, $ADLOCKBATCHOPTIMISTIC )$objRecordSet.MoveFirst(); =========== FAILED ATTEMPTS BELOW =============Global Const $NULL_ZERO = 0Global Const $NULL_STRING = ""Global Const $NULL_DEFAULT = Default;~ $objRecordSet.ActiveConnection = $NULL_ZERO;~ $objRecordSet.ActiveConnection = $NULL_STRING;~ $objRecordSet.ActiveConnection = $NULL_DEFAULT;~ $objRecordSet.ActiveConnection = 0;~ $objRecordSet.ActiveConnection = "";~ $objRecordSet.ActiveConnection = Default; ===============================================$objRecordSet.ActiveConnection = ; ????????$objConnection.Close(); If successful, we should retrieve a valueConsoleWrite( $objRecordSet(0).Value & @CRLF) Edited November 27, 2007 by zfisherdrums Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
ptrex Posted November 27, 2007 Share Posted November 27, 2007 @zfisherdrumsMaybe this can get you started :Disconnected RecordSet Exampleregardsptrex 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...
zfisherdrums Posted November 27, 2007 Author Share Posted November 27, 2007 All my forum searches used "ADO" instead of ADOR. This would explain why I didn't stumble upon your blatantly obvious post before. Thanks! I'll be looking at your example more in depth. Please note that the uploaded file on that post is returning a Board Message indicating that it might not be there any longer. I'll assume for now that the code block is the same. Zach... Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
ptrex Posted November 27, 2007 Share Posted November 27, 2007 @zfisherdrums I fixed the attached file again. So you can have a look at this if you need to. thanks ptrex 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...
zfisherdrums Posted November 27, 2007 Author Share Posted November 27, 2007 Thanks for doing that. I downloaded it and ran into a few problems that I believe are stemming from the new AutoIt version. Despite your post's self-effacing intro, your code is easy to follow logically. I realize your intent was to provide a springboard - which it succeed in. My context differs slightly in that I must connect to an existing data store, fill the data set, then disconnect. I believe the heart of the issue is the lack of a NULL in AutoIT. This is assuming there isn't another way to produce a NULL value or some other blatant language feature I've glossed over. If you ( or any readers within eye-shot ) know of a way to produce NULL values, I'd love to see it. Thanks again for your help. Zach... Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
zfisherdrums Posted November 27, 2007 Author Share Posted November 27, 2007 Closing this thread. I've posted the real problem here. Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog... Link to comment Share on other sites More sharing options...
ptrex Posted November 27, 2007 Share Posted November 27, 2007 (edited) @I don't think that an "$objConnection.ActiveConnection" can be blank or 0 ?!the activeconnection can only after it's been defined $objConnection.Open(" ..." ) or "$objConnection.Close()"When you want to use a DISCONNECTED recordset from an active connection, you will have to use the ADOR.The way it should be done is you open a ADODB.connection AND a ADOR.RecordSet simultaniously.Then you read the records of the ADODB and fill them in the ADOR.RecordSet. Then you close the ADODB.connection prperly.And you will end up with a DISCONNECTED recordSet in de ADOR dataset.Look here for an example on how to fill a ADOR with some data from something elseDisconnected RecordSetregards,ptrex Edited November 27, 2007 by ptrex 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...
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