Skip site navigation (1) Skip section navigation (2)

RE: your mail

From: Bob Kline <bkline(at)rksystems(dot)com>
To: Aziz ABI <abi(at)mail(dot)cbi(dot)net(dot)ma>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: RE: your mail
Date: 2000-12-13 13:13:20
Message-ID: Pine.LNX.4.10.10012130810030.6006-100000@rksystems.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
On Wed, 13 Dec 2000, Aziz ABI wrote:

> Merci pour votre exemple
> 
> Mais ce que je veux c'est de crer une connexion ODBC  partie d'un
> programme VB sans passer par ODBC 32 du panneau de configuration.
> 
> Merci

Ah, sounds as if you want to create the DSN, not the connection.

Try this:

Declare Function SQLConfigDataSource Lib "ODBCCP32" _
    (ByVal pWind As Long, _
   ByVal reqType As Long, _
    ByVal driver As String, _
     ByVal attrs As String) As Long

Private Sub Form_Load()
    Dim rc As Long
    ' 1=ODBC_ADD_DSN
    rc = SQLConfigDataSource(0, 1, "PostgreSQL", _
                             "DSN=NouvelleDS" & Chr(0) & _
                             "Servername=foo" & Chr(0) & _
                             "Username=bar" & Chr(0) & _
                             "Port=5432" & Chr(0) & _
                             "Protocol=6.4" & Chr(0) & _
                             "ReadOnly=0" & Chr(0) & _
                             "RowVersioning=0" & Chr(0) & _
                             Chr(0))
    If rc = 0 Then
        MsgBox "Can't create data source"
    Else
        MsgBox "Data source created successfully"
    End If
End Sub

-- 
Bob Kline
mailto:bkline(at)rksystems(dot)com
http://www.rksystems.com



pgsql-interfaces by date

Next:From: Adam LangDate: 2000-12-13 13:46:50
Subject: Re: Re: your mail
Previous:From: Thomas LockhartDate: 2000-12-13 05:00:04
Subject: Re: JDBC, Timestamp and getting microseconds

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group