Re: postgresql and VB - Mailing list pgsql-general

From Masse Jacques
Subject Re: postgresql and VB
Date
Msg-id 0B87317EA62BD211A02A00A0C9DFB7EC9B5ED4@hermes.bordeaux.cemagref.fr
Whole thread Raw
In response to postgresql and VB  (Mourad Dhambri <mourad_dhambri@yahoo.fr>)
List pgsql-general
It does within Access 2000 and DAO lib. Create a pass-through query (direct
query to pg) and passing a parameter "id" to the pg_function
-----------------------------------------
Function my_func(id As String)

    Dim wrkODBC As DAO.Workspace
    Dim qdfTemp As DAO.QueryDef
    Dim connexion As DAO.Connection
    Dim rstTemp As DAO.Recordset
    Dim qdfString As String

    Set wrkODBC = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC)
    Workspaces.Append wrkODBC
    Set connexion = wrkODBC.OpenConnection("Connection1", dbDriverNoPrompt,
,
"ODBC;DSN=mydbase;DATABASE=mydbase;SERVER=myserver;PORT=5432;UID=user;PWD=pa
ssword")
    Set qdfTemp = connexion.CreateQueryDef("")
    qdfString = "SELECT(my_pg_function(" & id & "))"
    Debug.Print "Query results for " & qdfString
    Set rstTemp = connexion.OpenRecordset(qdfString, dbOpenDynamic)
    With rstTemp
        Do While Not .EOF
            Debug.Print , !f_desc
            .MoveNext
        Loop
        .Close
    End With
    connexion.Close
    wrkODBC.Close

End Function
--------------------------------------------
___________________________________________
Jacques Massé
Tel. 33 (0)5 57 89 08 11 - Fax 33 (0)5 57 89 08 01


-----Message d'origine-----
De : Mourad Dhambri [mailto:mourad_dhambri@yahoo.fr]
Envoyé : vendredi 6 septembre 2002 08:53
À : pgsql-general@postgresql.org
Objet : [GENERAL] postgresql and VB


Hi,
I would like to know how I could call a postgresql
function from VB.
Thanks.

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Date not being parsed as expected
Next
From: Oliver Elphick
Date:
Subject: Re: Date not being parsed as expected