firstly i make a table in sql and want to know the table data through info
so for that i write the job..but every time i run this job it shows the 3 error...
1)
ODBC operation failed.
Unable to log on to the database.
2) [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
3) Object 'OdbcConnection' could not be created..
static void sqlstatement1(Args _args)
{
OdbcConnection Connection;
LoginProperty loginprop;
SqlStatementExecutePermission Permission ;
Statement stmt;
ResultSet result;
str Dsn,UID,PWD,connectionstring,sqlstmt;
;
Dsn="datasource";
UID="";
PWD="";
connectionstring=strfmt("Dsn=%1;UID=%2;PWD=%3",Dsn,UID,PWD);
loginprop=new LoginProperty();
loginprop.setOther(connectionstring);
Connection=new OdbcConnection(loginprop);
sqlstmt="select * from Employees";
Permission=new SqlStatementExecutePermission(sqlstmt);
Permission.assert();
stmt=Connection.createStatement();
result=stmt.executeQuery(sqlstmt);
while(result.next())
{
print(strfmt("Empname:%1",result.getString(1)));
}
pause;
CodeAccessPermission::revertAssert();
}