From: | jose ricardo <joripeca(at)yahoo(dot)com(dot)ar> |
---|---|
To: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: Conectarse a Postgresql desde Visual basic 6 |
Date: | 2005-07-02 16:12:49 |
Message-ID: | 20050702161249.18240.qmail@web60924.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
hola
mira a ver si esta funcion te sirve, si la puedes
mejorar te agradeceria que me lo informes.
Public Sub Conectar(usuario As String, Contrasena As
String, Conect As Connection, Db as string, Ip as
string)
Dim StrConexion As String
StrConexion = "Provider=MSDASQL.1;Password=" &
Contrasena & ";Persist Security Info=TRUE;User ID=" &
usuario & ";Extended
Properties=DSN=PostgreSQL;DATABASE=" & db & ";SERVER="
& Ip & ";PORT=5432;UID=" & User &
";READONLY=0;PROTOCOL=6.4;FAKEOIDINDEX=0;SHOWOIDCOLUMN=0;ROWVERSIONING=0;SHOWSYSTEMTABLES=0;CONNSETTINGS=;FETCH=100;SOCKET=4096;UNKNOWNSIZES=0;MAXVARCHARSIZE=254;MAXLONGVARCHARSIZE=8190;DEBUG=0;COMMLOG=0;OPTIMIZER=1;KSQO=1;USEDECLAREFETCH=0;TEXTASLONGVARCHAR=1;UNKNOWNSASLONGVARCHAR=0;BOOLSASCHAR=1;PARSE=0;CANCELASFREESTMT=0;EXTRASYSTABLEPREFIXES=dd_;"
If Conect.State = adStateClosed Then
Conect.Open StrConexion, usuario, Contrasena
End If
End Sub
debes configurar el odbc de postgres. antes de
ejecutar tu aplicacion, tabien debes ejecutar el
servidor para que te acepte conexiones, para la cual
se utiliza el paramentro -i al ejecutar el postmaster
Cualquier cosa me gustaria que nos mantuvieramos en
contacto, yo estoy desarrollando un proyecto en vb 6
sp6 y la db esta en postgres 8.0.2. ya que me parece
magnifico compartir la experiencia con alguien.
--- SolSoft & Computadores <solsoft_rg(at)hotmail(dot)com>
escribió:
> Cordial saludo
>
> Estoy tratando de conectar a una base de datos
> postgres y me ha sido imposible, ya tengo
> establecido el odbc y estoy usando una cadena de
> conexion pero no he podido. Agradeceria mucho si me
> pudieran colaborar indicandome los pasos a seguir
>
> Mil gracias
>
> Ruben Acosta
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
From | Date | Subject | |
---|---|---|---|
Next Message | Jaime Casanova | 2005-07-02 18:39:17 | Re: Conectarse a Postgresql desde Visual basic 6 |
Previous Message | Fernando Aguada | 2005-07-02 15:10:42 | Re: Conectarse a Postgresql desde Visual basic 6 |