Dynamics Ax 2009 Installation Pre-requisites.
In all cases, you must be a member of the Administrators group on the local computer where you are installing a component. The following table lists permissions that are required in addition to administrator access on the computer.
Components Required.
Connecting MSSQL DataBase with X++ Code.
As part of Customer requirements , sometimes we need to connect to DataBase otherthan Axapta DataBase. So let us explore how it can be done with X++ code.
In Ax using ODBCConnection and LoginProp its possible to connect to Database on remote server, as illustrated in the following example.I tried the following code on MSSQL Server.
static void test_ODBCConnection(Args _args)
{
LoginProperty loginProp;
ODBCConnection conn;
Resultset resultSet, resultSetCount; // get record
Statement statement1, statement2; // Create SQL Statement
ResultSetMetaData metaData ; // get Record metadate like columnname.
;
// Set Server Database
loginProp = new LoginProperty();
loginProp.setServer('SON15092');
loginProp.setDatabase('AdventureWorksDW');
// Create Connection and SQL Statement
conn = new ODBCConnection(loginProp);
statement1 = conn.createStatement();
resultSet = statement1.executeQuery("SELECT * from DimTime");
while (resultSet.next())
{
metaData = resultSet.getMetaData();
info("Column Name :"+metaData.getColumnName(1)+" Value ="+resultSet.getString(1));
}
}
Enjoy, X++!!!!!!
In Ax using ODBCConnection and LoginProp its possible to connect to Database on remote server, as illustrated in the following example.I tried the following code on MSSQL Server.
static void test_ODBCConnection(Args _args)
{
LoginProperty loginProp;
ODBCConnection conn;
Resultset resultSet, resultSetCount; // get record
Statement statement1, statement2; // Create SQL Statement
ResultSetMetaData metaData ; // get Record metadate like columnname.
;
// Set Server Database
loginProp = new LoginProperty();
loginProp.setServer('SON15092');
loginProp.setDatabase('AdventureWorksDW');
// Create Connection and SQL Statement
conn = new ODBCConnection(loginProp);
statement1 = conn.createStatement();
resultSet = statement1.executeQuery("SELECT * from DimTime");
while (resultSet.next())
{
metaData = resultSet.getMetaData();
info("Column Name :"+metaData.getColumnName(1)+" Value ="+resultSet.getString(1));
}
}
Enjoy, X++!!!!!!
Subscribe to:
Posts (Atom)