pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Israel Zavalza Bahena <izavalza@hotmail.com>
To: pgsql-interfaces@postgresql.org
Subject: ODBC & Visual Basic 4.0 & POSTGRESQL
Date: Fri, 09 Apr 1999 18:27:51 PDT
Message-ID: <19990410012752.92340.qmail@hotmail.com> (raw)




>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
>
>
>>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


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



Message-ID: <19990410012752.92340.qmail@hotmail.com>
Permalink:  ../19990410012752.92340.qmail@hotmail.com/
Also on:    postgresql.org/message-id/19990410012752.92340.qmail@hotmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: izavalza@hotmail.com
  Subject: Re: ODBC & Visual Basic 4.0 & POSTGRESQL
  In-Reply-To: <19990410012752.92340.qmail@hotmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox