Цитата:
Сообщение от
ansoft
Как переключиться в текущем соединении...
...на другую БД? Подскажите...
переменная odbcConnection - член класса
X++:
#ODBCConnectionEntries
//инициализация класса
public boolean init(
str _server, //имя сервера
str _database, //база данных
str _login,
str _password
)
{
LoginProperty LP;
str otherStr;
;
LP = new LoginProperty();
otherStr = "DRIVER={SQL Server}";
otherStr += ";Trusted_Connection=No";
otherStr += strfmt(";SERVER=%1", _server);
otherStr += strfmt(";DataBase=%1", _database);
otherStr += strfmt(";UID=%1", _login);
otherStr += strfmt(";PWD=%1", _password);
LP.setOther(otherStr);
odbcConnection = new OdbcConnection(LP);
if (! odbcConnection)
{
return checkFailed("Ошибка при создании соединения");
}
return true;
}