Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2005

Tip: Looking for answers? Try searching our database.

how to register Date and Time Picker thru code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex - 27 Sep 2005 18:41 GMT
Hi,
I'm using the MS Date and Time Picker Control 6.0.

Is any way to check if it's registered (MSCOMCT2.OCX) on a user machine and
if not to copy and register it programmatically (VB) during the form or app
downloading?
Cheryl - 28 Sep 2005 18:36 GMT
Use FileSystemObject to see if the file is there. If it is not, copy it and
register it with a  bat file that contains the following 2 lines:

xcopy mscomct2.ocx c:\windows\system32\mscomc2.ocx
regsvr32 /s MSCOMCT2.OCX

Signature

Cheryl

> Hi,
> I'm using the MS Date and Time Picker Control 6.0.
>
> Is any way to check if it's registered (MSCOMCT2.OCX) on a user machine and
> if not to copy and register it programmatically (VB) during the form or app
> downloading?
Alex - 28 Sep 2005 18:50 GMT
Thanks, Cheryl.

Could you please clarify how I could use this FileSystemObject and how I
could generate that bat file?

For now I'm using the API-only approach Stephen Lebans has at
http://www.lebans.com/monthcalendar.htm

It's working well. But, sometimes I'm getting the error message:
"YOu must instantiate the MonthCalendar Class object before you call this
function     The code behind the sample Form shows you how to do this in the
Form's Load event
This must appear here!
Create an instance of our Class
Private Sub Form_Load()
Set mc = New clsMonthCal
You must set the class hWndForm prop!!!
mc.hWndForm = Me.hWnd"

> Use FileSystemObject to see if the file is there. If it is not, copy it and
> register it with a  bat file that contains the following 2 lines:
[quoted text clipped - 8 lines]
> > if not to copy and register it programmatically (VB) during the form or app
> > downloading?
Cheryl - 28 Sep 2005 20:37 GMT
   Dim fs As FileSystemObject
   Set fs = New FileSystemObject
   If Not fs.FileExists("c:\windows\system32\mscomc2.ocx") Then
       Shell App.Path & "\regmscomc2.bat"
   End If

This would assume that regmscomc2.bat is in the same path as the program you
are running and has these two lines in it
> > xcopy mscomct2.ocx c:\windows\system32\mscomc2.ocx
> > regsvr32 /s MSCOMCT2.OCX

You'll have to put your copy of mscomct2.ocx in a location where it can be
copied from.

> Thanks, Cheryl.
>
[quoted text clipped - 27 lines]
> > > if not to copy and register it programmatically (VB) during the form or app
> > > downloading?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.