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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-interfaces by date

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