Select * causes a crash, or How I learned to Hate VB

From: Corey Gibbs <cgibbs(at)westmarkproducts(dot)com>
To: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Select * causes a crash, or How I learned to Hate VB
Date: 2002-08-08 15:35:58
Message-ID: 01C23EB6.9F3ADC40.cgibbs@westmarkproducts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-odbc by date

  From Date Subject
Next Message Dave Page 2002-08-08 15:36:17 Re: Select * causes a crash, or How I learned to Hate VB
Previous Message Eng Kern Shen 2002-08-08 11:44:51 Problem with psqlODBC 07.02.0001and VB 6