BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

"Object was open" error with TADOQuery

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Ashok
Guest





PostPosted: Thu Sep 18, 2003 7:01 pm    Post subject: "Object was open" error with TADOQuery Reply with quote



ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add(SQLStmt);
ADOQuery1.ExecSQL;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('SELECT TABLE_NAME FROM ALL_TABLES where TABLE_NAME =');
ADOQuery1.SQL.Add(QuotedStr(TheTableName));
ADOQuery1.Open;

I am sometimes getting "Object was Open" error on the last line >>
(ADOQuery1.Open;).

I am using Oracle 8i database.
ADOQuery1.CursorLocation := clUseServer
and
ADOQuery1.CursorType := ctKeyset
is set in Object Inspector

In above code, I am using CREATE TABLE customer
in ADOQuery1.ExecSQL
then
using ADOQuery1
I want to find out if customer TABLE was created successfully
where I set TheTableName = 'customer'
but ADOQuery1.Open sometime gives "Object was open" error.

How do I fix this ?
By the way the customer TABLE does not have any indexes.

Thanks,
Ashok


Back to top
Viatcheslav V. Vassiliev
Guest





PostPosted: Fri Sep 19, 2003 8:06 am    Post subject: Re: "Object was open" error with TADOQuery Reply with quote



It is DB_E_OBJECTOPEN error:

The provider would have to open a new connection to support the operation,
and DBPROP_MULTIPLECONNECTIONS is set to VARIANT_FALSE. Any streams used to
pass input parameters are not released.

DBPROP_MULTIPLECONNECTIONS is "Multiple Connections" property on
TADOConnection.

//----------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Ashok" <ashok (AT) ureach (DOT) com> сообщил/сообщила в новостях следующее:
news:3f6a0102$1 (AT) newsgroups (DOT) borland.com...
Quote:
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add(SQLStmt);
ADOQuery1.ExecSQL;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('SELECT TABLE_NAME FROM ALL_TABLES where TABLE_NAME
=');
ADOQuery1.SQL.Add(QuotedStr(TheTableName));
ADOQuery1.Open;

I am sometimes getting "Object was Open" error on the last line
(ADOQuery1.Open;).

I am using Oracle 8i database.
ADOQuery1.CursorLocation := clUseServer
and
ADOQuery1.CursorType := ctKeyset
is set in Object Inspector

In above code, I am using CREATE TABLE customer
in ADOQuery1.ExecSQL
then
using ADOQuery1
I want to find out if customer TABLE was created successfully
where I set TheTableName = 'customer'
but ADOQuery1.Open sometime gives "Object was open" error.

How do I fix this ?
By the way the customer TABLE does not have any indexes.

Thanks,
Ashok






Back to top
Ashok
Guest





PostPosted: Fri Sep 19, 2003 4:31 pm    Post subject: Re: "Object was open" error with TADOQuery Reply with quote



Viatcheslav,

I have this problem when I use one TADOConnection
and use some SELECT statements, then CREATE TABLE sql statement.

Then to confirm DBPROP_MULTIPLECONNECTIONS situation,
I created 2nd TADOConnection for exclusive use to send sql "CREATE TABLE"
and "Opject was oper" error did not occur.

How can I use just one TADOConnection and set DBPROP_MULTIPLECONNECTIONS
to appropriate value ?

Thanks,
Ashok

"Viatcheslav V. Vassiliev" <support (AT) oledbdirect (DOT) com> wrote

Quote:
It is DB_E_OBJECTOPEN error:

The provider would have to open a new connection to support the operation,
and DBPROP_MULTIPLECONNECTIONS is set to VARIANT_FALSE. Any streams used
to
pass input parameters are not released.

DBPROP_MULTIPLECONNECTIONS is "Multiple Connections" property on
TADOConnection.

//----------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Ashok" <ashok (AT) ureach (DOT) com> сообщил/сообщила в новостях следующее:
news:3f6a0102$1 (AT) newsgroups (DOT) borland.com...
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add(SQLStmt);
ADOQuery1.ExecSQL;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('SELECT TABLE_NAME FROM ALL_TABLES where TABLE_NAME
=');
ADOQuery1.SQL.Add(QuotedStr(TheTableName));
ADOQuery1.Open;

I am sometimes getting "Object was Open" error on the last line
(ADOQuery1.Open;).

I am using Oracle 8i database.
ADOQuery1.CursorLocation := clUseServer
and
ADOQuery1.CursorType := ctKeyset
is set in Object Inspector

In above code, I am using CREATE TABLE customer
in ADOQuery1.ExecSQL
then
using ADOQuery1
I want to find out if customer TABLE was created successfully
where I set TheTableName = 'customer'
but ADOQuery1.Open sometime gives "Object was open" error.

How do I fix this ?
By the way the customer TABLE does not have any indexes.

Thanks,
Ashok








Back to top
Viatcheslav V. Vassiliev
Guest





PostPosted: Sat Sep 20, 2003 6:26 am    Post subject: Re: "Object was open" error with TADOQuery Reply with quote

ADOConnection1.Properties['Multiple Connections'].Value := True.

However True is default for this property and some OLEDB providers may not
support this property.

//----------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Ashok" <ashok (AT) ureach (DOT) com> сообщил/сообщила в новостях следующее:
news:3f6b2f4c (AT) newsgroups (DOT) borland.com...
Quote:
Viatcheslav,

I have this problem when I use one TADOConnection
and use some SELECT statements, then CREATE TABLE sql statement.

Then to confirm DBPROP_MULTIPLECONNECTIONS situation,
I created 2nd TADOConnection for exclusive use to send sql "CREATE TABLE"
and "Opject was oper" error did not occur.

How can I use just one TADOConnection and set DBPROP_MULTIPLECONNECTIONS
to appropriate value ?

Thanks,
Ashok

"Viatcheslav V. Vassiliev" <support (AT) oledbdirect (DOT) com> wrote in message
news:3f6abaef$1 (AT) newsgroups (DOT) borland.com...
It is DB_E_OBJECTOPEN error:

The provider would have to open a new connection to support the
operation,
and DBPROP_MULTIPLECONNECTIONS is set to VARIANT_FALSE. Any streams used
to
pass input parameters are not released.

DBPROP_MULTIPLECONNECTIONS is "Multiple Connections" property on
TADOConnection.

//----------------------
Regards,
Viatcheslav V. Vassiliev
http://www.oledbdirect.com
The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Ashok" <ashok (AT) ureach (DOT) com> сообщил/сообщила в новостях следующее:
news:3f6a0102$1 (AT) newsgroups (DOT) borland.com...
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add(SQLStmt);
ADOQuery1.ExecSQL;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('SELECT TABLE_NAME FROM ALL_TABLES where
TABLE_NAME
=');
ADOQuery1.SQL.Add(QuotedStr(TheTableName));
ADOQuery1.Open;

I am sometimes getting "Object was Open" error on the last line
(ADOQuery1.Open;).

I am using Oracle 8i database.
ADOQuery1.CursorLocation := clUseServer
and
ADOQuery1.CursorType := ctKeyset
is set in Object Inspector

In above code, I am using CREATE TABLE customer
in ADOQuery1.ExecSQL
then
using ADOQuery1
I want to find out if customer TABLE was created successfully
where I set TheTableName = 'customer'
but ADOQuery1.Open sometime gives "Object was open" error.

How do I fix this ?
By the way the customer TABLE does not have any indexes.

Thanks,
Ashok










Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.