Обсуждение: need help with errors in ODBC log

Поиск
Список
Период
Сортировка

need help with errors in ODBC log

От
Carolyn Lu Wong
Дата:
This problem is regarding VB5 application connection to postgreSQL
V6.5 via PsqlODBC V6.5. I'm not sure if the problem is related to ODBC
or the database. Please let me know if I should direct the question to
another discussion group.

When I try to open a record set from VB with a simple select
statement, results are retrieved if I connect to database on a local
server. However, if I try to retrieve data from remote server (via
internet) with the same code, I get the following error: '3669:
Execution Cancelled' (source - DAO.Connection).

The statement I try to open the record set with is 'select * from
accounts where account_no = 3;' I have included extractions from the
ODBC log files for both cases. The only difference I can see is in the
case where error arises, it has additional 'select * from select *
from....' in the log. I don't know where the 'select *' that comes
before the select statement comes from.

The following is extracted from the log from ODBC driver where data is
retrieved successfully:

conn=37254888, query='select *  from accounts  where account_no = 3 ;
'   [ fetched 1 rows ]
conn=37254888, query='SELECT * FROM accounts'   [ fetched 1182 rows ]
conn=37254888, query='select ta.attname, ia.attnum from pg_attribute
ta, pg_attribute ia, pg_class c, pg_index i where c.relname =
'accounts_pkey' AND c.oid = i.indexrelid AND ia.attrelid =
i.indexrelid AND ta.attrelid = i.indrelid AND ta.attnum =
i.indkey[ia.attnum-1] order by ia.attnum'   [ fetched 1 rows ]
conn=37254888, query='select c.relhasrules from pg_user u, pg_class c
where u.usesysid = c.relowner and c.relname like 'accounts''   [ fetched 1 rows ]
conn=37254888, query='select * from hist_ac_payment  where account_no
= 3 order by id desc; '   [ fetched 0 rows ]

And the following is extracted from the log from ODBC driver where I
get the error:

conn=41514824, query='select *  from accounts  where account_no = 3 ;
'   [ fetched 1 rows ]
conn=41514824, query='SELECT * FROM accounts'   [ fetched 1342 rows ]
conn=41514824, query='select ta.attname, ia.attnum from pg_attribute
ta, pg_attribute ia, pg_class c, pg_index i where c.relname =
'accounts_pkey' AND c.oid = i.indexrelid AND ia.attrelid =
i.indexrelid AND ta.attrelid = i.indrelid AND ta.attnum =
i.indkey[ia.attnum-1] order by ia.attnum'   [ fetched 1 rows ]
conn=41514824, query='select c.relhasrules from pg_user u, pg_class c
where u.usesysid = c.relowner and c.relname like 'accounts''   [ fetched 1 rows ]
conn=41514824, query='SELECT * FROM select *  from accounts  where
account_no = 3 ; '
ERROR from backend during send_query: 'ERROR:  parser: parse error at
or near "select"'
STATEMENT ERROR: func=SC_execute, desc='', errnum=1, errmsg='Error
while executing the query'               
------------------------------------------------------------                hdbc=41514824, stmt=41617568, result=0
         manual_result=0, prepare=0, internal=0                bindings=0, bindings_allocated=0
parameters=0,parameters_allocated=0                statement_type=0, statement='SELECT * FROM select * 
 
from accounts  where account_no = 3 ; '                stmt_with_params='SELECT * FROM select *  from
accounts  where account_no = 3 ; '                data_at_exec=-1, current_exec_param=-1, put_data=0
currTuple=-1,current_col=-1, lobj_fd=-1                maxRows=0, rowset_size=1, keyset_size=0,
 
cursor_type=0, scroll_concurrency=1                cursor_name='SQL_CUR027B08A0'                ----------------QResult
Info
-------------------------------
CONN ERROR: func=SC_execute, desc='', errnum=110, errmsg='ERROR: 
parser: parse error at or near "select"'          
------------------------------------------------------------           henv=41492040, conn=41514824, status=1,
num_stmts=16          sock=41514016, stmts=41513288, lobj_type=-999           ---------------- Socket Info
 
-------------------------------           socket=520, reverse=0, errornumber=0, errormsg='(NULL)'
buffer_in=41525160,buffer_out=41529264           buffer_filled_in=50, buffer_filled_out=0,
 
buffer_read_in=50


RE: need help with errors in ODBC log

От
Dave Page
Дата:

> -----Original Message-----
> From: Carolyn Lu Wong [mailto:carolyn@greatpacific.com.au]
> Sent: 07 November 2000 04:03
> To: pgsql-interfaces@postgresql.org
> Subject: [INTERFACES] need help with errors in ODBC log
> 
> 
> This problem is regarding VB5 application connection to postgreSQL
> V6.5 via PsqlODBC V6.5. I'm not sure if the problem is related to ODBC
> or the database. Please let me know if I should direct the question to
> another discussion group.
> 
> When I try to open a record set from VB with a simple select
> statement, results are retrieved if I connect to database on a local
> server. However, if I try to retrieve data from remote server (via
> internet) with the same code, I get the following error: '3669:
> Execution Cancelled' (source - DAO.Connection).
> 
> The statement I try to open the record set with is 'select * from
> accounts where account_no = 3;' I have included extractions from the
> ODBC log files for both cases. The only difference I can see is in the
> case where error arises, it has additional 'select * from select *
> from....' in the log. I don't know where the 'select *' that comes
> before the select statement comes from.
> 

The additional 'SELECT * FROM' is probably caused by having the command type
set to table rather than text in the data control. This causes the control
to assume that the recordsource is a tablename so it sticks SELECT * FROM in
front of it to create a complete query.

HTH,
Regards, Dave.


Re: need help with errors in ODBC log

От
Carolyn Lu Wong
Дата:

Dave Page wrote:
> 
> > -----Original Message-----
> > From: Carolyn Lu Wong [mailto:carolyn@greatpacific.com.au]
> > Sent: 07 November 2000 04:03
> > To: pgsql-interfaces@postgresql.org
> > Subject: [INTERFACES] need help with errors in ODBC log
> >
> >
> > This problem is regarding VB5 application connection to postgreSQL
> > V6.5 via PsqlODBC V6.5. I'm not sure if the problem is related to ODBC
> > or the database. Please let me know if I should direct the question to
> > another discussion group.
> >
> > When I try to open a record set from VB with a simple select
> > statement, results are retrieved if I connect to database on a local
> > server. However, if I try to retrieve data from remote server (via
> > internet) with the same code, I get the following error: '3669:
> > Execution Cancelled' (source - DAO.Connection).
> >
> > The statement I try to open the record set with is 'select * from
> > accounts where account_no = 3;' I have included extractions from the
> > ODBC log files for both cases. The only difference I can see is in the
> > case where error arises, it has additional 'select * from select *
> > from....' in the log. I don't know where the 'select *' that comes
> > before the select statement comes from.
> >
> 
> The additional 'SELECT * FROM' is probably caused by having the command type
> set to table rather than text in the data control. This causes the control
> to assume that the recordsource is a tablename so it sticks SELECT * FROM in
> front of it to create a complete query.
> 
> HTH,
> Regards, Dave.

The thing is, when I run the same application accessing database from
the local server (LAN), I don't have the VB 3669 error, and the
additional 'Select * from' does not exist in the log file. However, if
i'm accessing database from remote server (WAN), it causes the VB
error and there's additional 'select * from' in the log file! Apart
from the differences in the data, both database table definitions are
identical.

FYI, the source of the recordset in VB is SQL statement.


Re: need help with errors in ODBC log

От
"Apostolos B. STERGIOPOULOS"
Дата:
<div><div><h2>Re: need help with errors in ODBC log</h2><ul><li><strong>From</strong>: <strong>Carolyn Lu Wong <<a
href="mailto:carolyn@greatpacific.com.au">carolyn@greatpacific.com.au</a>></strong><li><strong>To</strong>:
<strong>DavePage <<a
href="mailto:dpage@vale-housing.co.uk">dpage@vale-housing.co.uk</a>></strong><li><strong>Subject</strong>:
<strong>Re:need help with errors in ODBC log</strong><li>Date: Wed, 08 Nov 2000 09:22:19 +1100 </ul><hr /><pre>>
DavePage wrote:<br />> > <br />> > > -----Original Message-----<br />> > > From: Carolyn Lu
Wong[mailto:carolyn@greatpacific.com.au]<br />> > > Sent: 07 November 2000 04:03<br />> > > To: <a
href="mailto:pgsql-interfaces@postgresql.org">pgsql-interfaces@postgresql.org</a><br/>> > > Subject:
[INTERFACES]need help with errors in ODBC log<br />> > ><br />> > ><br />> > > This problem
isregarding VB5 application connection to postgreSQL<br />> > > V6.5 via PsqlODBC V6.5. I'm not sure if the
problemis related to ODBC<br />> > > or the database. Please let me know if I should direct the question to<br
/>>> > another discussion group.<br />> > ><br />> > > When I try to open a record set from
VBwith a simple select<br />> > > statement, results are retrieved if I connect to database on a local<br
/>>> > server. However, if I try to retrieve data from remote server (via<br />> > > internet) with
thesame code, I get the following error: '3669:<br />> > > Execution Cancelled' (source - DAO.Connection).<br
/>>> ><br />> > > The statement I try to open the record set with is 'select * from<br />> >
>accounts where account_no = 3;' I have included extractions from the<br />> > > ODBC log files for both
cases.The only difference I can see is in the<br />> > > case where error arises, it has additional 'select *
fromselect *<br />> > > from....' in the log. I don't know where the 'select *' that comes<br />> > >
beforethe select statement comes from.<br />> > ><br />> > <br />> > The additional 'SELECT *
FROM'is probably caused by having the command type<br />> > set to table rather than text in the data control.
Thiscauses the control<br />> > to assume that the recordsource is a tablename so it sticks SELECT * FROM in<br
/>>> front of it to create a complete query.<br />> > <br />> > HTH,<br />> > Regards,
Dave.</pre></div><div>>The thing is, when I run the same application accessing database from<br />> the local
server(LAN), I don't have the VB 3669 error, and the<br />> additional 'Select * from' does not exist in the log
file.However, if<br />> i'm accessing database from remote server (WAN), it causes the VB<br />> error and
there'sadditional 'select * from' in the log file! Apart<br />> from the differences in the data, both database
tabledefinitions are<br />> identical.</div><p>> FYI, the source of the recordset in VB is SQL statement.<hr
/><fontcolor="#0000ff" size="3"><p>The following two lines represent a code fragment that can be used with the VB
development;we can place these lines within our 'Main' routine(s) and <i>'massage'</i> their values to iron-out many
accessproblems, not excluding the infamous <i>'Database Cancellation' </i>run-time error 3669:</font><font
color="#008080"face="Courier New" size="3"><p>glLoginTimeout = Val(GetINIString("LoginTimeout", "20"))<p>glQueryTimeout
=Val(GetINIString("QueryTimeout", "60"))</font><font color="#0000ff" size="3"><p>BTW, the values presented above, are
thedefault values for these properties. I attach a couple of extracts from the VB on-line help, to shed more light into
thisissue.</font><font color="#0000ff" size="3"><p>Enjoy,<p><u>-Toli       :-)</u></font><font color="#993366"
face="Arial"size="2"><p></font>____________________________________________________________ <br /><br />         I Only
KnowOne Thing -- That I Know Nothing! (SOCRATES) <br />____________________________________________________________ <br
/></div><brclear="all" /><hr />Get Your Private, Free E-mail from MSN Hotmail at <a
href="http://www.hotmail.com">http://www.hotmail.com</a>.<br/>