Thanks to all that told me about needing unique indexes in order to access
an ODBC database. One of my tables has a three part composite primary key.
I'm assuming that all primary keys have by default unique indexes. I found
that I didn't have the "recognize Unique Indexes" box checked in my ODBC
driver.
To make things simple I created one (1) table with two columns in my
PostgreSQL database:
CREATE TABLE race(
raceid serial PRIMARY KEY,Description char(30) NOT NULL
)
Then I wrote a little code to try to update the table using VB5:
Option Explicit
Dim rsWarHammer As Recordset
Dim dbWarHammer As Database
Private Sub cmdAdd_Click() rsWarHammer.AddNew MsgBox (rsWarHammer.Updatable) rsWarHammer!Description =
txtDescription.Text rsWarHammer.Update
End Sub
Private Sub Form_Load() Dim strConnect As String, strSQL As String strSQL = "SELECT RaceID, Description FROM race"
strConnect = "ODBC;uid=eric;pwd=grnthing;database = warhammer" Set dbWarHammer = OpenDatabase("", , False,
strConnect) Set rsWarHammer = dbWarHammer.OpenRecordset(strSQL)
End Sub
The message box now tells me that the record set is updateable! This is
good news. It use to return a false.
I still get an error however: "Run-time error '3155': ODBC --insert on
linked table '???' failed.
What's the missing piece here?
Thanks again!