<!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 AppVer: 6.0.97.82 ModName: psqlodbc30a.dll<br>
ModVer: 8.2.4.0 Offset: 00016edc<br>
----------------------------------------------------------------------------
<br>
Dim dbOut As ADODB.Connection<br>
Dim rsOut As ADODB.Recordset<br>
Set dbOut = New ADODB.Connection<br>
Set rsOut = New ADODB.Recordset<br>
<br>
With dbOut<br>
.ConnectionString = "Driver={PostgreSQL
ANSI};Server=localhost;Port=5432;Database=postgres;Uid=user;Pwd=secret;"<br>
.Open<br>
With rsOut<br>
rsOut.Open """Contact1""", dbOut, adOpenDynamic,
adLockOptimistic, adCmdTable<br>
Do<br>
.AddNew<br>
For Each fld In .Fields<br>
Debug.Print fld.name, fld.Type<br>
Select Case fld.Type<br>
Case 3 'integer (oid)<br>
Case 200, 202 'Memo -- Text (ANSI: 200,
Unicode: 202)<br>
fld.value = "Memo type text"<br>
Case 133 'Date<br>
fld.value = Date<br>
Case Else<br>
fld.value =
"FixedLengthStrings" <br>
End Select<br>
Next fld<br>
<b>.Update</b><br>
'Exit Loop code here<br>
Loop<br>
.Close<br>
End With<br>
.Close<br>
End With<br>
Set dbOut = Nothing<br>
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(at)AxiomInt(dot)com">dcio(at)AxiomInt(dot)com</a>
<a class="moz-txt-link-abbreviated" href="http://www.AxiomInt.com">www.AxiomInt.com</a>
</pre>
</body>
</html>