Обсуждение: postgresql and VB

Поиск
Список
Период
Сортировка

postgresql and VB

От
Mourad Dhambri
Дата:
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

Re: postgresql and VB

От
Masse Jacques
Дата:
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