How To retrieve servername and servertype?

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
edited 2009-03-01 in How Tos section
How To retrieve servername and servertype?

http://www.mibuso.com/howtoinfo.asp?FileID=2

Discuss this How To here.

Comments

  • AnonymousAnonymous Guest Posts: 137
    not clear enough, please try to simplify it so i can understand
  • AnonymousAnonymous Guest Posts: 137
    In a introduction stage I was need to understand, what base I Use. To clean understand this, I use another form of this function, and plase it's result to main form (330).
    On modification of your variant:
    GetServerName() : Text[30]
    ltxtTemp := CONTEXTURL;
    i := STRPOS(ltxtTemp,'servername=');
    IF i > 0 THEN BEGIN
      ltxtTemp := COPYSTR(ltxtTemp,i + 11,999);
      i := STRPOS(ltxtTemp,'&');
      EXIT(COPYSTR(ltxtTemp,1,i - 1));
    END
    ELSE BEGIN
      i := STRPOS(ltxtTemp,'database=');
      IF i > 0 THEN BEGIN
       ltxtTemp := COPYSTR(ltxtTemp,i + 9,999);
       i := STRPOS(ltxtTemp,'&');
       EXIT(COPYSTR(ltxtTemp,1,i - 1));
       END ELSE EXIT('');
      END;
    
  • slahaslaha Member Posts: 16
    How to get server date from client machine
  • rdebathrdebath Member Posts: 383
    Thankyou, I'd forgotten about this trick.

    BTW: if slaha is still around ...
    CREATE VIEW [dbo].[Server Time]
    AS
    SELECT     '' AS [Key], CURRENT_TIMESTAMP AS ServerTime
    
    OBJECT Table 50000 Server Time
    {
      OBJECT-PROPERTIES
      {
        Date=23/02/09;
        Time=21:14:28;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        DataPerCompany=No;
        LinkedObject=Yes;
      }
      FIELDS
      {
        { 1   ;   ;Key                 ;Code10         }
        { 2   ;   ;ServerTime          ;DateTime       }
      }
      KEYS
      {
        {    ;Key                                      }
      }
      CODE
      {
        BEGIN
        END.
      }
    }
    

    Just do a GET on the table.
  • krikikriki Member, Moderator Posts: 9,112
    You should make a tips/tricks topic for this one!
    rdebath wrote:
    Thankyou, I'd forgotten about this trick.

    BTW: if slaha is still around ...
    CREATE VIEW [dbo].[Server Time]
    AS
    SELECT     '' AS [Key], CURRENT_TIMESTAMP AS ServerTime
    
    OBJECT Table 50000 Server Time
    {
      OBJECT-PROPERTIES
      {
        Date=23/02/09;
        Time=21:14:28;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        DataPerCompany=No;
        LinkedObject=Yes;
      }
      FIELDS
      {
        { 1   ;   ;Key                 ;Code10         }
        { 2   ;   ;ServerTime          ;DateTime       }
      }
      KEYS
      {
        {    ;Key                                      }
      }
      CODE
      {
        BEGIN
        END.
      }
    }
    

    Just do a GET on the table.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.