Thread: ODBC ServerSide Cursors Error

ODBC ServerSide Cursors Error

From
"Ryan C. Bonham"
Date:
Hi,

I am using the 7.01.0007 ODBC driver, to connect my VB 6.0SP4 program to
postgresql. I have a form which contains a datagrid. The Data grid is
connected to a Postgre View. I had it set to readonly, and server side
cursors. If i tried to scroll the datagrid down to view more records, it
would cause a Exception Error "-1073741819(c0000005) access violation". I
finally figured out that if i set it to client side cursors that the error
went away. Is this a bug or should i not be using server side cursors in
this case?  I have the Dr. Watson Log if that would help in fixing the
problem, i didn't attach it due to it's size.

Thanks for your help.

Ryan C. Bonham

Re: ODBC ServerSide Cursors Error

From
Hiroshi Inoue
Date:
"Ryan C. Bonham" wrote:
>
> Hi,
>
> I am using the 7.01.0007 ODBC driver, to connect my VB 6.0SP4 program to
> postgresql. I have a form which contains a datagrid. The Data grid is
> connected to a Postgre View. I had it set to readonly, and server side
> cursors.

What kind of data control are you using ?
Does datagrid mean DBGrid ?

regards,
Hiroshi Inoue

Re: ODBC ServerSide Cursors Error

From
"Ryan C. Bonham"
Date:
Hi,

Sorry it took me so long to get back to you.  I was using the
DataEnvironment to make the dataconnection. Yes i menat DBGrind, sorry about
the confusion.. The errors only occur if i am using a view with server side
cursors. If i change the connection to a table or client side cursors, then
everything works as expected. If you want me to try anything let me know...
I pasted the last bit of information in form the ODBC Log File..

Also here are the results based on cursor type.
Table: All cursor types  and locking work fine.
View: Client Side Cursors Works like a charm.
View: Dynamic cursor type with server side cursors and pessemistic locking
returns 0 records
View: Static cursor type with server side cursors and any readonly locking
returns all records and then dies if you try to scroll with the DBGRid(also
dies with CommponentOnes True DBGrid.


This is the ODBC log file right after a crash with the Static Keyset with
serverside cursors and readonly locking.

    [ PostgreSQL version string = 'PostgreSQL 7.1 on i686-pc-linux-gnu,
compiled by GCC 2.96' ]
    [ PostgreSQL version number = '7.1' ]
conn=225120184,
PGAPI_DriverConnect(out)='DSN=Test1;DATABASE=Dog;SERVER=10.0.0.6;PORT=5432;U
ID=phpuser;PWD=;READONLY=0;PROTOCOL=6.4;FAKEOIDINDEX=1;SHOWOIDCOLUMN=0;ROWVE
RSIONING=0;SHOWSYSTEMTABLES=0;CONNSETTINGS=;FETCH=100;SOCKET=4096;UNKNOWNSIZ
ES=0;MAXVARCHARSIZE=254;MAXLONGVARCHARSIZE=8190;DEBUG=0;COMMLOG=1;OPTIMIZER=
1;KSQO=1;USEDECLAREFETCH=0;TEXTASLONGVARCHAR=1;UNKNOWNSASLONGVARCHAR=0;BOOLS
ASCHAR=0;PARSE=1;CANCELASFREESTMT=0;EXTRASYSTABLEPREFIXES=dd_;'
conn=225120184, query='select * from "possibleheatview"'
    [ fetched 1083 rows ]
conn=225120184, query='select u.usename, c.relname, a.attname, a.atttypid,
t.typname, a.attnum, a.attlen, a.atttypmod, a.attnotnull, c.relhasrules from
pg_user u, pg_class c, pg_attribute a, pg_type t where u.usesysid =
c.relowner and c.oid= a.attrelid and a.atttypid = t.oid and (a.attnum > 0)
and c.relname like 'possibleheatview' order by attnum'
    [ fetched 8 rows ]
PGAPI_Columns:
table='possibleheatview',field_name='initial',type=1042,sqltype=214123440,na
me='bpchar'
PGAPI_Columns:
table='possibleheatview',field_name='heatnumber',type=23,sqltype=214123440,n
ame='int4'
PGAPI_Columns:
table='possibleheatview',field_name='inheat',type=16,sqltype=214123440,name=
'bool'
PGAPI_Columns:
table='possibleheatview',field_name='checked',type=16,sqltype=214123440,name
='bool'
PGAPI_Columns:
table='possibleheatview',field_name='notes',type=1043,sqltype=214123440,name
='varchar'
PGAPI_Columns:
table='possibleheatview',field_name='dog',type=1043,sqltype=214123440,name='
varchar'
PGAPI_Columns:
table='possibleheatview',field_name='date',type=1184,sqltype=214123440,name=
'timestamp'
PGAPI_Columns:
table='possibleheatview',field_name='room',type=1042,sqltype=214123440,name=
'bpchar'
conn=224857336, PGAPI_Disconnect
conn=224911160, PGAPI_Disconnect
> -----Original Message-----
> From: Hiroshi Inoue [mailto:Inoue@tpf.co.jp]
> Sent: Tuesday, October 09, 2001 9:37 PM
> To: Ryan C. Bonham
> Cc: Pgsql-Odbc (E-mail)
> Subject: Re: [ODBC] ODBC ServerSide Cursors Error
>
>
> "Ryan C. Bonham" wrote:
> >
> > Hi,
> >
> > I am using the 7.01.0007 ODBC driver, to connect my VB
> 6.0SP4 program to
> > postgresql. I have a form which contains a datagrid. The
> Data grid is
> > connected to a Postgre View. I had it set to readonly, and
> server side
> > cursors.
>
> What kind of data control are you using ?
> Does datagrid mean DBGrid ?
>
> regards,
> Hiroshi Inoue
>

Re: ODBC ServerSide Cursors Error

From
"Ryan C. Bonham"
Date:
Hiroshi,

That seems to have fixed my problem, I can no longer reporduce the error.

Thank you,

Ryan
> -----Original Message-----
> From: Hiroshi Inoue [mailto:Inoue@tpf.co.jp]
> Sent: Wednesday, October 17, 2001 1:58 PM
> To: Ryan C. Bonham
> Subject: RE: [ODBC] ODBC ServerSide Cursors Error
>
>
> > -----Original Message-----
> > From: Ryan C. Bonham [mailto:Ryan@srfarms.com]
> >
> > Hiroshi,
> >
> > I will gladdly try the fix. Send the dll to me.
> >
>
> Please try the attached dll.
>
> regards,
> Hiroshi Inoue
>