VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Connecting PostgreSQL via System ODBC DSN?

1 REPLY 1
SOLVED
Reply
Message 1 of 2
mucip
825 Views, 1 Reply

Connecting PostgreSQL via System ODBC DSN?

Hi,

I have PostgreSQL ODBC SystemDSN and tested connection successfully.

I have below VB code and connecting PostgreSQL without problem.

Dim SQLKomut As String
Dim MyCommand As OdbcCommand
Dim myConnectionString As String = ("Dsn=PostgreSQL35W;Server=127.0.0.1;Port=5432;Database=NameOfUser;Uid = postgres;Pwd=PASS")

Dim myConnection = New OdbcConnection(myConnectionString)

        Try
            myConnection.Open()            
        Catch ex As Exception
            MsgBox("Veri tabanına ulaşılamıyor!")
            MsgBox(ex.Message)
            Exit Sub
        End Try

SQLKomut = "DELETE from agac_takas;"
MyCommand = New OdbcCommand(SQLKomut, myConnection)
MyCommand.ExecuteNonQuery()

 

But I could not do the same thing in VBA?

 

Regards,

Mucip:)

1 REPLY 1
Message 2 of 2
mucip
in reply to: mucip

Hi,

I found a solution here. Thanks.

https://forums.autodesk.com/t5/vba/saving-data-to-mdb-from-autocad-vba/td-p/350175

 

 

Regards,

Mucip:)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost