Hello,
there is a workaround for your problem when you use the latest released
version of the precompiler (7.3.0.21). The following code snipped works
proper in my environment:
int make_connection (char* user, char* passwd){
EXEC SQL BEGIN DECLARE SECTION;
char command[256];
EXEC SQL END DECLARE SECTION;
sprintf(command, "connect %s identified by %s isolation level 0", user,
passwd);
EXEC SQL EXECUTE IMMEDIATE :command;
return sqlca.sqlcode;
}
Regards,
Marco
----------------------------------------------
Marco PASKAMP
SAP DB, SAP Labs Berlin
> -----Original Message-----
> From: Paskamp, Marco
> Sent: Dienstag, 2. April 2002 09:04
> To: 'Pavithra'; [EMAIL PROTECTED]
> Subject: RE: Connection - Problem
>
>
> Hello,
> I can reproduce the error in my environment. It's a bug in
> the precompiler
> runtime, that after a connect error the internal state of this connect
> comand will not be set correctly. So you cannot reuse this
> connect command
> for further connects. This bug will be fixed in the next
> version of the
> precompiler. Thank you for reporting the bug.
>
> Regards,
> Marco
> ----------------------------------------------
> Marco PASKAMP
> SAP DB, SAP Labs Berlin
>
> > -----Original Message-----
> > From: Pavithra [mailto:[EMAIL PROTECTED]]
> > Sent: Montag, 1. April 2002 12:08
> > To: [EMAIL PROTECTED]
> > Subject: Connection - Problem
> >
> >
> > Hi,
> >
> > We encounter some problem while connecting to the database.
> >
> > First if we give wrong user name and password the
> > connection fails. Immediately if we try with correct user
> > name and password the connection fails. It returns "-9801
> > Invalid command state".
> >
> > If we first connect with correct user name and password
> > , disconnecting , connecting with wrong user name and
> > password and again connecting with correct user name password
> > does not create any problem.
> >
> > I am attaching the .pct file with this one.
> >
> > regards,
> > Pavithra.P
> >
> >
> >
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
>
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general