SnArF Posted July 15, 2010 Posted July 15, 2010 I want to connect to postgres DB 8.4 I now connect to MS SQL #include <_sql.au3> #include <array.au3> Opt ("trayIconDebug",1) _SQL_RegisterErrorHandler();register the error handler to prevent hard crash on COM error $oADODB = _SQL_Startup() If $oADODB = $SQL_ERROR then Msgbox(0 + 16 +262144,"Error",_SQL_GetErrMsg()) If _sql_Connect(-1,"server","database","user","pass") = $SQL_ERROR then Msgbox(0 + 16 +262144,"Error",_SQL_GetErrMsg()) _SQL_Close() Exit EndIf $hData = _SQL_Execute(-1,"SELECT * FROM [user].[User];") Local $aData,$iRows,$iColumns;Variables to store the array data in to and the row count and the column count $iRval = _SQL_GetTable2D(-1,"SELECT TOP 100000 * FROM [user].[table];",$aData,$iRows,$iColumns) If $iRval = $SQL_OK then _arrayDisplay($aData,"2D (" & $iRows & " Rows) (" & $iColumns & " Columns)" ) _SQL_Close() How can I do the same with Postgres DB? My scripts: _ConsoleWriteLog | _FileArray2D
PsaltyDS Posted July 15, 2010 Posted July 15, 2010 There isn't an AutoIt UDF (ASFAIK) for PostgreSQL, but you probably can do standard ADO connection stuff with the right connection strings. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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