Re: [pgsql-ayuda] PSQL ODBC & Visual Basic

From: "Israel Zavalza Bahena" <izavalza(at)hotmail(dot)com>
To: pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx
Subject: Re: [pgsql-ayuda] PSQL ODBC & Visual Basic
Date: 1999-04-14 09:52:08
Message-ID: 19990414165209.3232.qmail@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Gracias por toda su ayuda... me ha sido de mucha utilidad

Saludos

Ing. Israel Zavalza Bahena
http://www.geocities.com/Eureka/Enterprises/8937/israel.html

Internet Consulting & Bussines solutions on the WWW

http://www.geocities.com/Eureka/Enterprises/8937/index.html

mailto:izavalza(at)hotmail(dot)com

>From: Postmaster <Eduardo_Gargiulo(at)cgp(dot)net(dot)ar>
>Reply-To: pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx
>To: pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx
>Subject: Re: [pgsql-ayuda] PSQL ODBC & Visual Basic
>Date: Wed, 14 Apr 1999 03:45:19 +0000
>
>Israel Zavalza wrote:
>
>> Gracias, y disculpando la ignorancia...
>>
>> eso como se hace ?
>>
>> --- Postmaster <Eduardo_Gargiulo(at)cgp(dot)net(dot)ar> wrote:
>> > Israel Zavalza Bahena wrote:
>> >
>> > > Saludos a la lista...
>> > >
>> > > Estoy Manejando Postgres *version Linux 5.1 MX con
>> > Visual Basic 4.0 ,
>> > > utilizando el manejador ODBC actual de Insight
>> > corp, ya los declare
>> > > en mi se conecta a la base de datos, toma los
>> > datos de las tablas
>> > > respectivas e inserta renglones... pero cuando
>> > deseo hacer un UpDate
>> > > o un delete de las mismas tablas, me dice VB que
>> > el objeto no es
>> > > actualizable ( esto erroneo, debido a que cuando
>> > inserto valores,
>> > > tambien estoy escribiendo)... un pedazo de codigo
>> > ejemplo para un
>> > > boton de comando cualquiera es el siguiente en un
>> > MsgBox....
>> > >
>> > > Private Sub Command4_Click()
>> > > Dim db As Database
>> > > Dim Comando As Variant
>> > > Dim n As Integer
>> > > Set db = OpenDatabase("PostgreSQL", False, False,
>> > "ODBC;")
>> > > Comando = "delete from alumnos where nombre like
>> > 'Israel'"
>> > > db.Execute Comando
>> > > ' db.Execute "insert into students values
>> > ('Alejandro','23 anos')"
>> > > db.Close
>> > > End Sub
>> > >
>> > > Notese el comentario en la antepenultima linea
>> > >
>> > > ejecutado arroja el siguiente error :
>> > >
>> > > se ha producido el error 3073 de tiempo de
>> > ejecucion
>> > > LA Operacion debe usar una consulta actualizable
>> > >
>> > > pero si comento del delete (update en su caso) y
>> > descomento el
>> > > Insert, ya no marca ningun error , e inserta los
>> > valores en la
>> > > tabla !!!!!!!!!
>> > >
>> > > El driver esta configurado para usar el usuario
>> > creador de la base de
>> > > datos (postgres) y el servidor tiene un archivo
>> > pg_hba.conf parecido
>> > > al siguiente (pongo un pedazo, lo demas son
>> > comentarios):
>> > >
>> > > # The above allows any user on the local system to
>> > connect to any
>> > > database
>> > > # under any username.
>> > >
>> > > #host template1 192.168.0.0
>> > 255.255.255.0 ident
>> > > sameuser
>> > >
>> > > # The above allows any user from any host with IP
>> > address 192.168.0.x
>> > > to
>> > > # connect to database template1 as the same
>> > username that ident on
>> > > that host
>> > > # identifies him as (typically his Unix username).
>> > >
>> > > #host all 192.168.0.1
>> > 255.255.255.255 reject
>> > > #host all 0.0.0.0 0.0.0.0
>> > trust
>> > >
>> > > # The above would allow anyone anywhere except
>> > from 192.168.0.1 to
>> > > connect to
>> > > # any database under any username.
>> > >
>> > > #host all 192.168.0.0
>> > 255.255.255.0 ident
>> > > omicron
>> > > #
>> > > # The above would allow users from 192.168.0.x
>> > hosts to connect to any
>> > > # database, but if e.g. Ident says the user is
>> > "bryanh" and he
>> > > requests to
>> > > # connect as Postgres user "guest1", the
>> > connection is only allowed if
>> > > # there is an entry for map "omicron" in
>> > pg_ident.conf that
>> > > says "bryanh" is
>> > > # allowed to connect as "guest1".
>> > >
>> > > # By default, allow anything over UNIX domain
>> > sockets and localhost.
>> > >
>> > > local all
>> > trust
>> > > host all 127.0.0.1
>> > 255.255.255.255 trust
>> > > host all una-IP
>> > 255.255.255.255 trust
>> > >
>> > >
>> > >
>> > > postgresql esta corriendo como postgres, y como se
>> > ve, uso el metodo
>> > > OPENDATABASE via ODBC....
>> > >
>> > > alguna surgerencia u otro metodo mejor para tal
>> > efecto?
>> > >
>> > > Gracias
>> > >
>> > >
>> > ______________________________________________________
>> > > Get Your Private, Free Email at
>> > http://www.hotmail.com
>> > > --------- Pie de mensaje
>> > -------------------------------------------
>> > > Archivo historico:
>> > http://tlali.iztacala.unam.mx/maillist/pgsql-ayuda
>> > > Cancelar inscripcion:
>> > > mail to: majordomo(at)tlali(dot)iztacala(dot)unam(dot)mx
>> > > text : cancelacion pgsql-ayuda
>> >
>> > Posiblemente sigas teniendo probelmas al ejecutar
>> > action querys con el
>> > metodo Execute del objeto database.
>> > Deberias probar ejecutarlas a traves de el mismo
>> > metodo pero con el
>> > objeto Connection, creando previamente un Espacio de
>> > Trabajo ODBC para
>> > dicho objeto.
>> >
>> > --
>> > ~~~~~~~~~~~~~~~~~~~~~~~
>> > Postmaster
>> > Eduardo_Gargiulo(at)cgp(dot)net(dot)ar
>> > gargiulo(at)mcolivia(dot)com(dot)ar
>> >
>> >
>> >
>> > --------- Pie de mensaje
>> > -------------------------------------------
>> > Archivo historico:
>> > http://tlali.iztacala.unam.mx/maillist/pgsql-ayuda
>> > Cancelar inscripcion:
>> > mail to: majordomo(at)tlali(dot)iztacala(dot)unam(dot)mx
>> > text : cancelacion pgsql-ayuda
>> >
>>
>> _________________________________________________________
>> Do You Yahoo!?
>> Get your free @yahoo.com address at http://mail.yahoo.com
>>
>> --------- Pie de mensaje ------------------------------------------
-
>> Archivo historico: http://tlali.iztacala.unam.mx/maillist/pgsql-
ayuda
>> Cancelar inscripcion:
>> mail to: majordomo(at)tlali(dot)iztacala(dot)unam(dot)mx
>> text : cancelacion pgsql-ayuda
>
>En primer lugar deberias crear un Workspace
>
>Dim wspODBC as Workspace
>Set wspODBC = CreateWorkspace("NewWorkspace","","",dbUseODBC)
>
>y posteriormente dimensionar un objeto connection sobre ese Workspace
>
>Dim connODBC as Connection
>Set conODBC = wspODBC.OpenConnection("",dbDriverPrompt,False,"ODBC;")
>
>Dim strSQL1, strSQL2 as String
>strSQL1 = "delete from table where field = 'xxx'"
>strSQL2 = "drop table table_name"
>
>connODBC.Execute strSQL1
>connODBC.Execute strSQL2
>connODBC.Close
>
>Esto deberia funcionar, de todos modos el metodo Execute tiene
algunos
>parametros extra que aparecen en el Help que pueden ser de mucha
ayuda.
>
>--
>~~~~~~~~~~~~~~~~~~~~~~~~~~
>Postmaster
>gargiulo(at)cgp(dot)net(dot)ar
>gargiulo(at)uaco(dot)unpa(dot)edu(dot)ar
>
>
>
>--------- Pie de mensaje -------------------------------------------
>Archivo historico: http://tlali.iztacala.unam.mx/maillist/pgsql-ayuda
>Cancelar inscripcion:
>mail to: majordomo(at)tlali(dot)iztacala(dot)unam(dot)mx
>text : cancelacion pgsql-ayuda

Ing. Israel Zavalza Bahena
http://www.geocities.com/Eureka/Enterprises/8937/israel.html

Internet Consulting & Bussines solutions on the WWW

http://www.geocities.com/Eureka/Enterprises/8937/index.html

mailto:izavalza(at)hotmail(dot)com

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
--------- Pie de mensaje -------------------------------------------
Archivo historico: http://tlali.iztacala.unam.mx/maillist/pgsql-ayuda
Cancelar inscripcion:
mail to: majordomo(at)tlali(dot)iztacala(dot)unam(dot)mx
text : cancelacion pgsql-ayuda

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Fernando Ariel Chevarro 1999-04-14 15:42:48 Re: [pgsql-ayuda] CONSEGUIDA LA INCLUSION DE LARGE OBJETS
Previous Message Omar Mendoza 1999-04-14 08:26:48 Re: [pgsql-ayuda] CONSEGUIDA LA INCLUSION DE LARGE OBJETS