How To retrieve servername and servertype?

AdministratorAdministrator Posts: 2,231Member, Moderator, Administrator
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 Posts: 137Guest
    not clear enough, please try to simplify it so i can understand
  • AnonymousAnonymous Posts: 137Guest
    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 Posts: 16Member
    How to get server date from client machine
  • rdebathrdebath Posts: 383Member
    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.
    Robert de Bath
    TVision Technology Ltd
  • krikikriki Posts: 7,865Member, Moderator
    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
    Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting

Sign In or Register to comment.