From: | "Eric Damron" <edamron(at)home(dot)com> |
---|---|
To: | <pgsql-interfaces(at)postgresql(dot)org> |
Subject: | ODBC and VB5 Progress... But still not there |
Date: | 2000-05-04 15:48:32 |
Message-ID: | 001401bfb5e0$33556740$0200a8c0@C287853-A.olmpi1.wa.home.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-interfaces |
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!
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2000-05-04 16:24:50 | Re: 7.0RC2 compile error ! |
Previous Message | Greg Brzezinski | 2000-05-04 06:29:40 | Re: Zeos download (was making winodbc driver better?) |