locked
VBScript format date function RRS feed

  • Question

  • How to use below VB funciton in 64 bit application ?

    Function FormatDateExpression(vExpression, sFormat) 
    
    set fmt = CreateObject("MSSTDFMT.StdDataFormat") 
     fmt.Format = sFormat 
     
    set rs = CreateObject("ADODB.Recordset") 
    rs.Fields.Append "fldExpression", 12 ' adVariant 
     
    rs.Open 
    rs.AddNew 
     
    set rs("fldExpression").DataFormat = fmt 
    
    if Isnull(vExpression) =false then
    	rs("fldExpression").Value = vExpression 
    	FormatDateExpression = rs("fldExpression").Value 
    else
    	FormatDateExpression = ""
    end if
     
    rs.close: Set rs = Nothing: Set fmt = Nothing 
     
    End Function

    This code works fine in 32 bit application but it not working in 64 bit.

    I have tried to register MSSTDFMT.dll in different folder for 32 and 64 bit regvsr32 register as per google search but no resolution.

    can any one guide for this problem ?

    Thanks


    • Edited by Viral84 Tuesday, May 8, 2018 11:11 AM
    • Moved by Reed KimbleMVP Tuesday, May 8, 2018 12:43 PM vb script in vb.net language
    Tuesday, May 8, 2018 11:11 AM

Answers

  • MSSTDFMT.dll is a VB 6 component. There is no 64-bit version since VB 6 is 32-bit and is no longer supported. You will need to update your code for .NET.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Tuesday, May 8, 2018 12:46 PM

All replies

  • You've posted to the VB.Net forum.  I'll move this to a scripting forum for better support.

    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Tuesday, May 8, 2018 12:43 PM
  • MSSTDFMT.dll is a VB 6 component. There is no 64-bit version since VB 6 is 32-bit and is no longer supported. You will need to update your code for .NET.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Tuesday, May 8, 2018 12:46 PM