Тема: Путь к БД
Показать сообщение отдельно
Старый 30.11.2008, 13:35   #2  
artkashin is offline
artkashin
Участник
MCBMSS
 
519 / 18 (2) ++
Регистрация: 06.12.2006
Код:
GetDatabaseServer(URL : Text[1024]) Result : Text[250]
// GetDatabaseServer

Result := '';
strPeriod := COPYSTR(URL, STRPOS(URL, 'servername=') + 11);
strPeriod := COPYSTR(strPeriod, 1, STRPOS(strPeriod, '&') - 1);
WHILE STRPOS(strPeriod, '\') > 0 DO
  strPeriod := COPYSTR(strPeriod, STRPOS(strPeriod, '\') + 1);
Result := strPeriod;

GetDatabaseName(URL : Text[1024]) Result : Text[250]
// GetDatabaseName

Result := '';
strPeriod := COPYSTR(URL, STRPOS(URL, 'database=') + 9);
strPeriod := COPYSTR(strPeriod, 1, STRPOS(strPeriod, '&') - 1);
WHILE STRPOS(strPeriod, '\') > 0 DO
  strPeriod := COPYSTR(strPeriod, STRPOS(strPeriod, '\') + 1);
Result := strPeriod;

GetCompanyName(URL : Text[1024]) ResultC : Text[250]
// GetCompanyname

ResultC := '';
strPeriod := COPYSTR(URL, STRPOS(URL, 'company=') + 8);
strPeriod := COPYSTR(strPeriod, 1, STRPOS(strPeriod, '&') - 1);
WHILE STRPOS(strPeriod, '\') > 0 DO
  strPeriod := COPYSTR(strPeriod, STRPOS(strPeriod, '\') + 1);
ResultC := strPeriod;