Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grabbing Date/Time from Remote Data Source

Status
Not open for further replies.

wsjames

Programmer
Apr 7, 2003
50
US
Is it possible via an ODBC connection to grab the current date/time from the remote data source? We are using a VFP 9.0 app and would like to validate date/time synchronization.
 
This should bring the date time to sqlresult.


LOCAL lnConn
LOCAL lnOutput
lnConn = SQLCONNECT('mysql')
IF m.lnConn > 0
SQLEXEC(lnConn, 'SELECT CURRENT_TIMESTAMP')

endif


If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
Jim,

Thank you so much for your response. I will give this a try and post results on Monday.
 
I'm not sure what your expertise is with SQL but I was a little lazy when I posted the other. Here are all the components if you need them.

LOCAL lnConn
LOCAL lnOutput
lnConn = SQLCONNECT('test')
IF m.lnConn > 0
SQLEXEC(lnConn, 'SELECT CURRENT_TIMESTAMP')
? Exp
USE
SQLDISCONNECT(m.lnConn)
endif

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
Hi WSJames,

The answer depends on which back-end you are using. There's no standard SQL command; each back-end has its own method.

For example, if you are using Microsoft SQL Server, you could SQLEXEC the following:

Code:
SELECT GETDATE()

For other servers, please let us know which back end you are using.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I am sorry for my delayed responsed, and thankful for each of your replies. With your inputs, we now have resolution.

Thank you again, and have blessed holiday and New Year.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top