Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OLE DB error using MS Enterprise Libraries (DAAB) and VS2005 (C#)

38 views
Skip to first unread message

robertoperez

unread,
Apr 21, 2008, 4:51:11 PM4/21/08
to
Introduction. I just want to let you know that I was able
to execute Sql Statements yesterday but now I am getting the
following error.

"Login Failed, Check for vaild user ID, server name and
password
[Native Error code: 4002]
[DataDirect ADO Sybase Provider] Login failed."

Same application is running smoothly in other PCs using the
same configuration. My connection string is as follow:

"Provider=Sybase.ASEOLEDBProvider.2;Server Name=<IP
address>;Server Port Address=<Port number";Initial
Catalog=<database name>;User
ID=<UserId>;Password=<password>;"

My configuration is:
-- XP profesional
-- VS2005
-- Sybase 12.5 (backend)
-- Sybase client OLE DB 12.5.0/P/02.50
Copyright 2001 Sybase, Inc.

Thank you for your help.
Roberto Perez
robert...@ky.gov

/**************************************************************/
This is something I want to share with you all guys. I would
like to explain that there is a small different executing
stored procedures between ODBC and OLE DB using Sybase
client 12.5

For ODBC your command must be "{ call storedproc_name() }"
For OLE DB your command must be "storedproc_name"

Take a look on this example

public String ExecStoredProc(String sConn, String sCommand)
{
// sConn can be "SybaseODBC" or "SybaseOLEDB"
// the connection string for each are defined on
web.config
Database db = DatabaseFactory.CreateDatabase(sConn);

if (sConn == "SybaseOLEDB") sCommand =
"sp_storedprocedure";
else sCommand = "{ call sp_storedprocedure(?)}";

DbCommand command = db.GetSqlStringCommand(sCommand);
int myInt = 123456;
command.CommandType = CommandType.StoredProcedure;
db.AddInParameter(command, "@i_id_param", DbType.Int32,
myInt);
try {
ds = new DataSet();
ds = db.ExecuteDataSet(command);
return ds.GetXml();
} catch (Exception ex) {
throw ex;
} finally {
if (ds != null) {
ds.Clear();
ds.Dispose();
}
if (command != null) command.Dispose();
}
}

Paul

unread,
Apr 22, 2008, 1:49:19 PM4/22/08
to
Hi Roberto,

You could try EBF 14058, upgrade to the OEM Provider you're using, or
upgrade to Sybase
version of OLEDB, found in SDK 12.5.1 or 15.0 installation
(%SYBASE%\DataAccess\OLEDB)
This would be Provider=ASEOLEDB, filename sybdrvoledb.dll.

The error looks like login failure - you might want to get RIBO setup to
capture TDS trace -
RIBO is found in %SYBASE%\jutils-2_0 - its a java based gateway utility
capturing and formating
the TDS packets between the client and server - in teh LOGIN packet you can
tell if the
username and password are correct or not.

-Paul

<Roberto Perez> wrote in message news:480cfe3f.430...@sybase.com...

Paul

unread,
Apr 22, 2008, 1:49:19 PM4/22/08
to
Hi Roberto,

The error means the cerdentials failed for some reason.
You ought to upgrade the oledb provider - this is the OEM provider and there
is a newer version - like EBF 14058.

Also on the Sybase OCS SDK 12.5.1 or 15.0 there is another OLEDB Provider to
use
if you;d like to try it.

Make sure you can ISQL to the same ASE with the same login credentials. You
might want to
get a tds trace to see what's going on between the client (OLEDB and ASE -
the RIBO utility would work for this -
in %SYBASE%\jutils-2_0\ribo - its a java based gateway utility which
captures the tds between client
and server and can format the output into readable form.

-Paul

<Roberto Perez> wrote in message news:480cfe3f.430...@sybase.com...

0 new messages