Re: Insert fails from VB only when table is empty...?

From: brew(at)theMode(dot)com
To: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Insert fails from VB only when table is empty...?
Date: 2003-03-28 20:02:12
Message-ID: Pine.BSF.4.44.0303281456150.66270-100000@themode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Kevin......

> I am brand new to pgsql... :-) I have a VB program inserting records
> into a fairly simple table (without a PK) and I notice that when the
> table is empty I get a "row out of range" error. This only happens when
> the table is empty.

I use PHP instead of VB, but it sounds like you should only try to fetch
the rows if some exist. In php the first row fetch starts at zero, so if
there is one row you ask for n-1, i.e. row zero. If no rows exist you use
an if statement to skip around the row fetch (and maybe print a no info
found message).

Maybe this is what's happening to you.

later....

brew

==========================================================================
Strange Brew (brew(at)theMode(dot)com)
Check out my Musician's Online Database Exchange (The MODE Pages)
http://www.TheMode.com
==========================================================================

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Steve Crawford 2003-03-28 21:40:47 Re: [NOVICE] Postgres Syslog
Previous Message Chad Thompson 2003-03-28 19:56:30 Re: Insert fails from VB only when table is empty...?