remote access
How to access server system time from an Visual basic application.
i am working on a employee scheduler
# 1 Re: remote access
If you are not in an NT client/server situation (which i do believe has an API call to get the server time), you can always create a temp file on the "server" machine, and the file will be created with a time/date stamp of the "server". I've tried this on a 98 client to a 98 "server" and NT4 Server.
# 2 Re: remote access
If you are not in an NT client/server situation (which i do believe has an API call to get the server time), you can always create a temp file on the "server" machine, and the file will be created with a time/date stamp of the "server". I've tried this on a 98 client to a 98 "server" and NT4 Server.
# 3 Re: remote access
The keyword you are searching for is: "Now()". I also have a function for various DBs:
public Enum DBMStype
dbmsUnknown = -1
dbmsSQL92 = 0 'SQL-92 Standard Compliant (Note: Access, SQL Server & Oracle are not)
dbmsAccess = 1
dbmsSqlServer = 2
dbmsOracle = 3
End Enum
'set this variable to the primary database of your application.
'then when using the SQL building routines, you do not have to pass in the
'optional DBMS type. Those routines will default to the value of PrimaryDBMS.
'If your application connects to more than one database, declare another variable
'of type DBMStype and pass that variable to the SQL building functions when
'building SQL strings for that database.
Global PrimaryDBMS as DBMStype
public Function SqlNow(optional byval GivenDBMS as DBMStype = dbmsUnknown) as string
'Returns a valid function call to the function that returns the current system time.
If GivenDBMS = dbmsUnknown then
GivenDBMS = PrimaryDBMS
End If
Select Case GivenDBMS
Case dbmsAccess
SqlNow = "Now()"
Case dbmsSqlServer
SqlNow = "GetDate()"
Case dbmsOracle
SqlNow = "SYSDATE"
Case else
Debug.Assert false
SqlNow = "Now()"
End Select
End Function
Regards,
Michi
michi at 2007-11-10 0:46:04 >

# 6 Re: remote access
thank you
can u send me the code for my question pls and the API call i need to use'
that is to access a server system time from a desktop visual basic application
i am using windows 2000