pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Finn Lassen <dcio@AxiomInt.com>
To: pgsql-odbc@postgresql.org
Subject: Need help with Visual Basic 6 and PostgreSQL
Date: Wed, 21 Nov 2007 21:36:57 -0500
Message-ID: <4744EB49.6050305@AxiomInt.com> (raw)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
I am very new to ADODB, ODBC and SQL databases.<br>
<br>
When I run the following which I wrote to populate tables (with data
from a Borland V database) , the Visual Basic Developer Interface
crashes with the following error signature (Windows XP):<br>
AppName: vb6.exe&nbsp;&nbsp;&nbsp; &nbsp;AppVer: 6.0.97.82&nbsp;&nbsp;&nbsp; &nbsp;ModName: psqlodbc30a.dll<br>
ModVer: 8.2.4.0&nbsp;&nbsp;&nbsp; &nbsp;Offset: 00016edc<br>
----------------------------------------------------------------------------&nbsp;
<br>
&nbsp;&nbsp;&nbsp; Dim dbOut As ADODB.Connection<br>
&nbsp;&nbsp;&nbsp; Dim rsOut As ADODB.Recordset<br>
&nbsp;&nbsp;&nbsp; Set dbOut = New ADODB.Connection<br>
&nbsp;&nbsp;&nbsp; Set rsOut = New ADODB.Recordset<br>
<br>
&nbsp;&nbsp;&nbsp; With dbOut<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .ConnectionString = "Driver={PostgreSQL
ANSI};Server=localhost;Port=5432;Database=postgres;Uid=user;Pwd=secret;"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Open<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With rsOut<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rsOut.Open """Contact1""", dbOut, adOpenDynamic,
adLockOptimistic, adCmdTable<br>
&nbsp;&nbsp;&nb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p;&nbsp;&nbsp;&nbsp;&nbsp; <b>.Update</b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Exit Loop code here<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Loop<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Close<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Close<br>
&nbsp;&nbsp;&nbsp; End With<br>
&nbsp;&nbsp;&nbsp; Set dbOut = Nothing<br>
&nbsp;&nbsp;&nbsp; Set rsOut = Nothing<br>
--------------------------------------------------------------------------------------------------------<br>
Note: I had to add a "oid" column to the table or the rsOut.Open would
fail with "ERROR: column "oid" does not exist;".<br>
<br>
It now crashes at the .Update statement.<br>
Previously it managed to add 2 rows to the table.<br>
Another oddity is when using the VB Visual Data Manager add-in to view
the database it will not list the Indexes for the Contact1 table.<br>
It will list the Indexes for the Contact2 table which is not populated
nor been worked with.<br>
<br>
Any suggestions on how proceed?<br>
Do I have to configure the PostgreSQL ANSI driver somehow? If so, how?<br>
<br>
Finn<br>
<pre class="moz-signature" cols="72">-- 
Finn Lassen
Deputy CIO
Axiom
1805 Drew Street
Clearwater, Florida 33765
727-442-7774 voice
727-442-8344 fax
<a class="moz-txt-link-abbreviated" href="mailto:dcio@AxiomInt.com">dcio@AxiomInt.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.AxiomInt.com">www.AxiomInt.com</a;
</pre>
</body>
</html>




view thread (16+ messages)  latest in thread

Message-ID: <4744EB49.6050305@AxiomInt.com>
Permalink:  ../4744EB49.6050305@AxiomInt.com/
Also on:    postgresql.org/message-id/4744EB49.6050305@AxiomInt.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: dcio@AxiomInt.com
  Subject: Re: Need help with Visual Basic 6 and PostgreSQL
  In-Reply-To: <4744EB49.6050305@AxiomInt.com>
  References: <4744EB49.6050305@AxiomInt.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