Hi Sai Sharan,

You can see the code in the standard DAX 2009 classes for your reference *
\Classes\SIGSigningProvider_SQLServer_Server*

Couple of suggestions for you, try to incorporate them.

a) Try to incroporate the Permission class.
b) Use the CCADO classes rather than ODBC classes for connecting to the
another database.
c) Be careful when supplying the login user name, make sure that the user
name that you are using to connect to other system should not be used more
than once.
d) Put the code inside the Try Catch statement, else you will not be able to
figure out as to why some error had happened at least that is the case for
the CCADO classes.

This is the sample code that i have posted from you. Here you can see that i
written the code inside the try catch block and see the last part where i
had done the exception handling this will give you detailed error message as
to why error is popping up. This code is consuming the CCADO classes.


void openConnection()
{
    System.Exception                     clrException;
    InteropPermission                    permission = new
InteropPermission(InteropKind::ClrInterop);
    Str                                              localConnectionString;
    ;
    try
    {
        permission.assert();
         // BP deviation documented
        sqlConnection  = new
System.Data.SqlClient.SqlConnection(sqlConnectionString);
        if(sqlConnection.get_State() != System.Data.ConnectionState::Open)
        {
            sqlConnection.Open();
        }
        else
        {
            info("Connection is already open !");
        }
        CodeAccessPermission::revertAssert();
    }
    catch(Exception::CLRError)
    {
        // BP deviation documented
        clrException = CLRInterop::getLastException();
        if (clrException != null)
        {
            clrException = clrException.get_InnerException();
            if (clrException != null)
            {
                //store error - don't throw here
                throw error(clrException.get_Message());
            }
        }
    }
}
Hope this will help you.

Have a nice day.

Regards,
ashish singh
             *<*
*accenture*

On Sat, Sep 4, 2010 at 6:30 PM, Sai Sharan <saisharan....@gmail.com> wrote:

>
>
> Hi all,
> i had a senario where i need to save some data from Ax_Database to another
> database. I had Written a code for connecting to the Externa database.
> It worked fine when i Executed my code in VPC(VirtualPC)., But when i
> Execute the same code in Client System it showed me a Problem
> saying that
> 1.ODBC operation failed.Unable to log on to the database.
> 2.[Microsoft][SQL Native Client]Login timeout expired.
> 3.Object 'OdbcConnection' could not be created.
>
> i wrote my code in SalesFormLetter Class and i caled from
> SalesFormLetter_PickingList.
>
> waiting fr ur valuable sugessions....
>
> 
>

Reply via email to