Thread: Problems with VB and ADO

Problems with VB and ADO

From
"Alessandro Giacometti"
Date:
i had some problems with the example about VB and ADO i found on
odbc.postresql.org :

i have a line like this :

rs.Open "SELECT id, data FROM vbtest", cn, adOpenDynamic

ok, my table is different, but the problem is that the recordset i obtain is
read only
unless i use the "adLockOptimistic" clause (which is not present in the
example)

another problem ( still not solved):

if i use rs.RecordCount i always obtain "-1" even if i use rs.MoveLast and
rs.MoveFirst.

My machine is a Win98
my server is Mandrake 8.1

thanx a lot

bye






Re: Problems with VB and ADO

From
Dave Page
Date:

> -----Original Message-----
> From: Alessandro Giacometti [mailto:ando@libero.it]
> Sent: 07 February 2002 17:20
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] Problems with VB and ADO
>
>
> i had some problems with the example about VB and ADO i found
> on odbc.postresql.org :
>
> i have a line like this :
>
> rs.Open "SELECT id, data FROM vbtest", cn, adOpenDynamic
>
> ok, my table is different, but the problem is that the
> recordset i obtain is read only unless i use the
> "adLockOptimistic" clause (which is not present in the
> example)

Do you have a trailing semi-colon on the end of the query?

> another problem ( still not solved):
>
> if i use rs.RecordCount i always obtain "-1" even if i use
> rs.MoveLast and rs.MoveFirst.

Yes, that is normal. There is a Microsoft Knowledgebase article about it I
believe though I don't know the ID.

Regards, Dave.

Re: Problems with VB and ADO

From
Keith Gray
Date:
Alessandro Giacometti wrote:
>
> i had some problems with the example about VB and ADO i found on
> odbc.postresql.org :
>

> if i use rs.RecordCount i always obtain "-1" even if i use rs.MoveLast and
> rs.MoveFirst.
>

I beleive you get counts from OpenStatic.


--
Keith Gray

Technical Development Manager
Heart Consulting Services P/L
mailto:keith@heart.com.au