Link to home
Start Free TrialLog in
Avatar of ieg
iegFlag for United Kingdom of Great Britain and Northern Ireland

asked on

msstdfmt.dll and vbscripts on windows server 2012

Hi
I have been using a format function based on msstdfmt.dll for many years to help format dates within a VBScript both on clients and servers. (see below).
It appears that msstdfmt.dll is no longer installed as standard on 64 bit operating systems.
Searching the web the advice seems to be to download a copy and register it on the machine running the VBScript.
Is this a sensible thing to do, or will it cause problems?
More importantly, is there a different way of achieving this code. It doesn't seem right to issue VBScript that can't run on a native operating system without downloading old components.

Hope you can help
Andy

Function Format(vExpression, sFormat)
 
     set fmt = CreateObject("MSSTDFMT.StdDataFormat")
     fmt.Format = sFormat

     Set rs = CreateObject("ADODB.Recordset")
     rs.Fields.Append "fldExpression", 12

     rs.Open
     rs.AddNew

     Set rs("fldExpression").DataFormat = fmt
     rs("fldExpression").Value = vExpression

     Format = rs("fldExpression").Value

     rs.close: Set rs = Nothing: Set fmt = Nothing

 End Function
ASKER CERTIFIED SOLUTION
Avatar of ieg
ieg
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial