Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » Classic Visual Basic (VB 6 or earlier) » COM/ActiveX » MSScript.ocx


MSScript.ocxExpand / Collapse
Author
Message
Posted 11/28/2008 5:03:44 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/19/2009 9:00:47 AM
Posts: 2, Visits: 9
Hi,

I have added the MSScript control to an APP in VB6 and i am having issues with the date format. My regional settings are set to UK but when i use now() function it is displayed as 11/28/2008. Has anyone got any ideas.

Thanks

Lee

Regards,

The Bard.
Post #26393
Posted 11/28/2008 8:27:54 PM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: Today @ 11:19:17 AM
Posts: 1,795, Visits: 4,572
Welcome to A1vbcode Lee

bardoel (11/28/2008)
Hi,

I have added the MSScript control to an APP in VB6 and i am having issues with the date format. My regional settings are set to UK but when i use now() function it is displayed as 11/28/2008. Has anyone got any ideas.

Well I never use Now because Now shows Date and Time. If I only want the date I use Date function. Now depending how your regional settings are set Date will give the current English date and Date$ will show the American date.

If its displaying 11/28/2008 then its showing the American date use the Date function.

I've never heard of MSScript where did you get it and what extra functions does it have? 

Keith

http://www.martin2k.co.uk/forums/index.php?act=idx

I've been programming with VB for 14 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
 
Post #26394
Posted 11/29/2008 5:40:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 2/19/2009 9:00:47 AM
Posts: 2, Visits: 9
Hi Keith,

Thaks but that still doesnt work. MSScript should come with VB it allows for your apps to run VBScript as a result the Date$ doesnt work and Date displays the date in mm/dd/yyyy format.

Thanks

Lee

Regards,

The Bard.
Post #26395
Posted 11/29/2008 9:05:01 AM
Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: 7/24/2010 7:12:23 PM
Posts: 994, Visits: 7,697
With vbscript you and easily separate the date parts and then reassmeble the however you want.

Option Explicit

Dim strDay, strMonth, strYear, strOutput

strDay = Day(Date)
strMonth = Month(Date)
strYear = Year(Date)

strOutput = strday & "/" & strMonth & "/" & strYear

MsgBox strOutput
Post #26399
Posted 11/29/2008 5:38:15 PM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: Today @ 11:19:17 AM
Posts: 1,795, Visits: 4,572
bardoel (11/29/2008)
Hi Keith,

MSScript should come with VB it allows for your apps to run VBScript as a result the Date$ doesnt work and Date displays the date in mm/dd/yyyy format.

Well Lee in all the years I've used VB I've never noticed MSScript. Is this a Reference or an ocx?  

Keith

http://www.martin2k.co.uk/forums/index.php?act=idx

I've been programming with VB for 14 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
 
Post #26403
Posted 11/29/2008 6:55:03 PM
Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: 7/24/2010 7:12:23 PM
Posts: 994, Visits: 7,697
I have it listed as Microsoft Script Control 1.0 under components. The path to the ocx on my machine is C:\WINDOWS\system32\msscript.ocx.
Post #26405
Posted 11/30/2008 10:21:16 AM


Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: Today @ 11:19:17 AM
Posts: 1,795, Visits: 4,572
Mark (11/29/2008)
I have it listed as Microsoft Script Control 1.0 under components. The path to the ocx on my machine is C:\WINDOWS\system32\msscript.ocx.

Thanks Mark but I don't have msscript.ocx in my system. I can't be a normal VB install else I would have it.

Keith

http://www.martin2k.co.uk/forums/index.php?act=idx

I've been programming with VB for 14 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
 
Post #26407
Posted 11/30/2008 4:55:55 PM
Forum God

Forum GodForum GodForum GodForum GodForum GodForum GodForum GodForum God

Group: Forum Members
Last Login: 7/24/2010 7:12:23 PM
Posts: 994, Visits: 7,697
Not that it really matters but this is what Microsoft says about the script control. "The Script control ships with Visual Basic 6.0; however, Visual Basic 6.0 setup does not install the Script Control for you." http://support.microsoft.com/kb/184739
Post #26409
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Admin, Mod

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 6:54pm