Jump to content
Sign in to follow this  

Postgres query

Recommended Posts

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())

    $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)" )


How can I do the same with Postgres DB?

My scripts: _ConsoleWriteLog | _FileArray2D




Share this post

Link to post
Share on other sites

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

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...