Call DirectSQL in AX (other database by ODBC)
static void LoadInventTable(Args _args)
{
str sDSN = "MSDN";
LoginProperty Lp;
OdbcConnection myConnection;
statement myStatement;
ResultSet myResult;
str myStr1;
SqlStatementExecutePermission sqlStatementExecutePermission;
;
Lp = new LoginProperty();
LP.setDSN(sDSN);
try
{
myConnection = new OdbcConnection(LP);
}
catch
{
info("Check username/password.");
return;
}
myStatement = myConnection.createStatement();
myStr1 ="select * from inventTableTmp";
sqlStatementExecutePermission = new SqlStatementExecutePermission(myStr1);
sqlStatementExecutePermission.assert();
rSet = myStatement .SQLQuery();
while(rSet.next())
{
print rSet.GetString(1);
print rSet.GetString(2);
}
}
posted on 2008-07-15 11:08 lingdanglfw 阅读(138) 评论(0) 编辑 收藏 举报