Subscribe to this thread
Home - General / All posts - ConnectionType error
oisink
370 post(s)
#14-Oct-14 18:31

Hi

I have an external application - in MS Access (32bit).

I am creating a new Manifold Document, which works, as follows:

Function MfdCreateDocument() As Manifold.Document

    Dim mfdApp As Manifold.Application

    Set mfdApp = Manifold.Application

    Set MfdCreateDocument = mfdApp.NewDocument("c:\surveymanager\manifold\test.map"False)

 

End Function

I then try to link some PostgreSQL VIEWS as follows:

Sub MfdLinkPGViews(mfdDocument As Manifold.Document)

 

    Set ds = mfdDocument.NewDataSource

    ds.ConnectionType = "PostgreSQL"

    Server = "Geohub"

    Port = "5432"

    UserName = "myusername"

    Password = "mypassword"

    Database = "mydatabase"

    ds.ConnectionString = "host='" + Server + "' port='" + Port + "' user='" + UserName + "' password='" + Password + "' dbname='" + Database + "'"

    ds.LinkDrawingFromTableGeometry "myPGView""geom", ColumnTypeGeomWKB

End Sub

This fails on ds.ConnectionType = "PostgreSQL". I've tried other connection types, which are recognised, just fails on "PostgreSQL". An essentially identical script in vbscript run from Manifold directly works fine. To be clear, the above is run from inside MS Access. It seems MS Access can't see PostgreSQL or psqlODBC. I have the path to PostgreSQL in my PATH variable.

Can anyone point me in the direction of tracing this fault.

Thanks

Oisin

oisink
370 post(s)
#14-Oct-14 19:20

I should have said...I can connect directly to PostgreSQL from Access both programmitcally and via the GUI, for instance to create or link to RELATIONS (Views and Tables). The problem only seems to occur when trying to connect to postgreSQL via Manifold. (As stated above, I can also connect from Manifold via the GUI and programatically).

Oisin

tjhb
10,094 post(s)
#15-Oct-14 00:06

Is your licence for Enterprise Edition, or Universal Edition or Database Administrator Edition or Ultimate Edition? One of those is required.

cartomatic

905 post(s)
#15-Oct-14 07:55

Assuming your manifold version can connect - have a look at your connection string and try the following:

ds.ConnectionString = "Server=" + Server + ";Port=" + Port + ";User ID=" + UserName + ";Password=" + Password + ";Database=" + Database + ";" 

more on pgsql connection strings here: http://www.connectionstrings.com/postgresql/


maps made easy - www.cartomatic.pl || www.cartoninjas.net

oisink
370 post(s)
#15-Oct-14 08:41

@tjhb - yes, Enterprise Edition.

@Cartomatic - still no joy, it fails before it even gets there, at ds.ConnectionType = "PostgreSQL".

I think this is the same issue I have here: http://www.georeference.org/forum/t122369.19#122370.

I've been advised to upgrade to 8.0.29 and try again - but I use 8.0.15 because of this here: http://www.georeference.org/forum/t102437.14#102491

Oisin

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.