Select * causes a crash, or How I learned to Hate VB - Mailing list pgsql-odbc

From Corey Gibbs
Subject Select * causes a crash, or How I learned to Hate VB
Date
Msg-id 01C23EB6.9F3ADC40.cgibbs@westmarkproducts.com
Whole thread Raw
List pgsql-odbc
Good Morning Everyone,

This problem with VB crashing isn't going away.  I know it's not a PG or an
ODBC problem, but i was wondering if anyone else has experenced this
behavor before in their vb-program development.

Here's what happens.  I've got the following table:

CREATE TABLE "snapshot" (
  "list_name" varchar(25),
  "phase" varchar(2),
  "cabinet_count" float4,
  "pstatus" varchar(1),
  "level" varchar(1),
  "job_number" varchar(6),
  "ship_date" varchar(6)
) WITH OIDS;


Now, in my program, when i do an
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Set rs = New ADODB.Recordset
Set cn = New ADODB.Connection

cn.Open
"Driver={PostgreSQL};Server=server4;Port=5432;Database=wpi_accrual;Uid=p
ostgres;"
rs.Open "select job_number,phase,pstatus,level,cabinet_count,ship_date from
snapshot WHERE list_name='" & List5.Text & "'", cn, adOpenKeyset,
adLockOptimistic

or when i
cn.Open
"Driver={PostgreSQL};Server=server4;Port=5432;Database=wpi_accrual;Uid=p
ostgres;"
rs.Open "select * from snapshot WHERE list_name='" & List5.Text & "'", cn,
adOpenKeyset, adLockOptimistic

VB pukes with an application error.  I know the query executes on the
server, i've watched the logs, and my odbc driver log says "experts agree,
everything is just fine".  but VB chokes.

I've solved it by making two record sets like this:
rs.Open "select job_number,phase,pstatus,level,cabinet_count,ship_date from
snapshot WHERE list_name='" & List5.Text & "'", cn, adOpenKeyset,
adLockOptimistic
rs2.Open "select list_name from snapshot WHERE list_name='" & List5.Text &
"'", cn, adOpenKeyset, adLockOptimistic

<whine>now i've got two record sets to track</whine>

what is weird is, i've got other select *'s on much larger tables with no
problems within the same program.

Anyone have any idea what's going on?  Or, if "that's the way it is" that's
cool too :).

thanks in advance
corey


pgsql-odbc by date:

Previous
From: "Eng Kern Shen"
Date:
Subject: Problem with psqlODBC 07.02.0001and VB 6
Next
From: "Dave Page"
Date:
Subject: Re: Select * causes a crash, or How I learned to Hate VB