Re: Error -1811
Posted in 2004
Andrew Hardy wrote:
> can somebody explain to me what this means:
>
> lesu273> finderr -1811
> -1811 Implicit connection not allowed after an explicit connection.
>
> Once you have used the CONNECT TO statement to establish an explicit
> connection to a database server, you cannot use one of the DATABASE
> statements to connect implicitly to another database server. After an
> explicit connection, you must use the CONNECT TO statement to connect
> to other database servers.
>
>
> If I have established an explicit connection to a db server, then surely
> any using one of the databse statements after tha, must be asumed to be
> sent to that server ?
Yes, but did you connect to the server or to a specific database on
the server?
You can create an implicit connection like this:
DATABASE 'joe@bloggs';
You can also create an implicit connection like this:
DATABASE 'joe';
You can create an explicit connection to a database like this:
CONNECT TO 'joe@bloggs';
After this, you cannot use any of the DATABASE statements.
You can create an explicit connection to a database server like this:
CONNECT TO '@bloggs';
And after this, you can do:
CREATE DATABASE bill; CLOSE DATABASE;
DATABASE joe; ...
CLOSE DATABASE;
And so on.
> So why does the statement I execute think it is for a different server ?
The error message is clear - you are not allowed to create an implicit
connection after you've made an explicit connection to a database.
The expansion of the error message is not as clear as it could be.
Better wording would be more like:
Once you use the CONNECT statement to establish an explicit connection
to a database, you cannot use any of the DATABASE statements when that
is the current connection. You can use the notation CONNECT TO
'dbase@server' to connect to a different database, or the notation
CONNECT TO '@server' to connect to a database server (after which, you
can use the various DATABASE statements in that connection).
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/