Re: Visual Basic and PostgreSQL ODBC

From: wsheldah(at)lexmark(dot)com
To: "Ryan C(dot) Bonham" <Ryan(at)srfarms(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Visual Basic and PostgreSQL ODBC
Date: 2001-07-27 17:26:08
Message-ID: 200107271727.NAA03882@interlock2.lexmark.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Check the type of your recordset, and then check the docs and see how that type
of recordset supports the RecordCount property. Or, post the code that sets up
the connection and recordset so we can take a look at it. If you really want to
keep deleting until there are none left, you could probably avoid the
RecordCount property altogether by changing the loop condition to:

Do Until rstRecord2.EOF

You also might consider finding a way to do the same thing with a
straightforward SQL statement. For instance, if you want to delete everyone
whose name is Smith, it looks like you're currently setting a recordset equal to
the results of "select name from customer where name='smith'", then cycling
through the recordset to delete them until there are none left. Quicker is to
execute a simple "delete from customer where name='smith'".

HTH,

Wes

"Ryan C. Bonham" <Ryan%srfarms(dot)com(at)interlock(dot)lexmark(dot)com> on 07/27/2001 12:59:36
PM

To: pgsql-odbc%postgresql(dot)org(at)interlock(dot)lexmark(dot)com
cc: pgsql-general%postgresql(dot)org(at)interlock(dot)lexmark(dot)com (bcc: Wesley
Sheldahl/Lex/Lexmark)
Subject: [GENERAL] Visual Basic and PostgreSQL ODBC

Hi,

Ok I have a problem, that I need to find a fix or workaround for. I have a
Visual Basic 6 application that calls on a PostgreSQL database. I have code
that calls a table and runs a loop on it, deleting recordsets until the
recordcount equals a certain number.. The code deletes the records fine, the
problem is the recordcount doesn't change.. Does anyone know what is going
on and how to fix it? Thank you

Ryan

VB CODE

rstRecord2.MoveFirst
Do Until rstRecord2.RecordCount = 0
rstRecord2.Delete
rstReocrd2.MoveNext
Debug.Print rstRecord2.RecordCount
Loop

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Felipe Zirbes 2001-07-27 17:28:47 RE: Visual Basic and PostgreSQL ODBC
Previous Message martin.chantler 2001-07-27 17:15:30 Re: Visual Basic and PostgreSQL ODBC