Translating [pgsql-ayuda] PSQL ODBC & Visual Basic - Mailing list pgsql-interfaces

From Israel Zavalza Bahena
Subject Translating [pgsql-ayuda] PSQL ODBC & Visual Basic
Date
Msg-id 19990410011416.11285.qmail@hotmail.com
Whole thread Raw
List pgsql-interfaces
Hi to all.... sorry , here is the translation...


Im Working with postgresql v 6.3, Visual Basic 4.0 and ODBC drivers
from insight corp, everithing declared under my control panel ODBC 32
bits, and works ok for selecting and inserting rows from tables. But,
when i  want to delete or update , visual basic says that the
operation must be an update capable query (!!!!!!). An piece of code
for a press button is the follow....


>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




When i comment (') the delete and un-comment the insert, everything
works fine, but not as shown.

I've also intent with the grant command like this...


grant all on alumnos to public...

but unsucessfully



an example of my pg_hba.conf is like this ...

#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         200.38.48.131 255.255.255.0     trust





please, if you have solved this previously, send me a comment ...



Was my mistake have choosen Postgresql for ODBC�s?









Thanks in advance


>From: "Israel Zavalza Bahena" <izavalza@hotmail.com>
>Reply-To: pgsql-ayuda@tlali.iztacala.unam.mx
>To: pgsql-ayuda@tlali.iztacala.unam.mx
>CC: psql-interfaces@postgresql.org
>Subject: [pgsql-ayuda] PSQL ODBC & Visual Basic
>Date: Fri, 09 Apr 1999 13:25:04 PDT
>
>
>
>
>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@tlali.iztacala.unam.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@hotmail.com


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

pgsql-interfaces by date:

Previous
From: "Ken J. Wright"
Date:
Subject: Re: [INTERFACES] ODBC Driver v06-40-0005
Next
From: "Israel Zavalza Bahena"
Date:
Subject: ODBC & Visual Basic 4.0 & POSTGRESQL