|
-
August 21st, 2003, 05:56 AM
#1
Solution Required -URGENT (MS-Access)
Hi,
Iam developing an Client Server Application using MS-Access. I use DSN for Connectivity from the Client End.
My requirement is I want to get the Server (Where the Database Resides) Date & Time for the Client Application.
I tried using this Statement "Select Date()" in a recordset and viewed the result but it show only the Client Systems Date.
Get me the Correct Solution..
Thank you .!!!
your's
Soundar
-
August 21st, 2003, 09:46 AM
#2
Hi, may be this?
rstTime.CursorLocation = adUseServer
-
August 21st, 2003, 10:10 AM
#3
Hi,,
Thanks for your reply.
I tried, on changing the Cursor Location, but still not solved.
Once again Thanks for your effort.
Please send your response when your get a solution.
BYe
Soundar
Originally posted by vbUserName
Hi, may be this?
rstTime.CursorLocation = adUseServer
your's
Soundar
-
August 21st, 2003, 10:20 AM
#4
-
August 22nd, 2003, 12:26 AM
#5
Hi
Hi,
Here is the Coding........
-----------------------------------------------------------------------------------
Public DB As New ADODB.Connection
Public lvRecTime As New ADODB.Recordset
Dim ConnStr As String
If DB.State = 1 Then
DB.Close
End If
ConnStr = "Provider=MSDASQL.1;Persist Security Info=False; Data Source=DAttendance"
DB.Mode = adModeReadWrite
DB.ConnectionString = ConnStr
DB.CursorLocation = adUseServer
DB.Open ConnStr
If lvRecTime.State = 1 Then
lvRecTime.Close
End If
lvRecTime.Open "Select date(),Time()", DB
Msgbox lvRecTime.Fields(0)
-----------------------------------------------------------------------------------
Am I in the Right path ???
Convey me Plz
Bye
Soundar
Originally posted by vbUserName
Can you send the code?
your's
Soundar
-
August 22nd, 2003, 05:50 AM
#6
Unfortunately, with MS Access there is no way to do this. MS Access will always pull the time from the computer you are on. It is not a database server. If you want to be able to do this, you will need to use another type of database (SQL Server, MSDE (SQL Server Limited), Oracle, DB2, PostgreSQL, MySQL). There are true database servers and will report the time back to you.
Now for a solution you might be able to use is to write a small app to run on the server with a winsock control, and have that app report the time to you.
Good Luck and Happy Programming.
Roger
-
August 22nd, 2003, 06:29 AM
#7
Thank you Roger,
That's the Best Solution.
Bye
Originally posted by sotoasty
Unfortunately, with MS Access there is no way to do this. MS Access will always pull the time from the computer you are on. It is not a database server. If you want to be able to do this, you will need to use another type of database (SQL Server, MSDE (SQL Server Limited), Oracle, DB2, PostgreSQL, MySQL). There are true database servers and will report the time back to you.
Now for a solution you might be able to use is to write a small app to run on the server with a winsock control, and have that app report the time to you.
Good Luck and Happy Programming.
Roger
your's
Soundar
-
August 22nd, 2003, 08:23 AM
#8
You could write a very small COM object that would sit on the server. Then, you could reference this from your Access database and write a function from Access that would call the COM DLL.
You could then create a query that uses the function you have written in Access!!
Your COM DLL could simply have 1 function in a class...
Public Function ServerTime As Date
ServerTime = Now()
End Function
Your Access function would be very similar....
Public Function GetServerTime As Date
Dim objServerDLL as YourProject.YourDLL
Set objServerDLL = New YourProject.YourDLL
GetServerTime = objServerDLL.ServerTime
Set objServerDLL = Nothing
End Function
You can now use this function in a query, and call the query via your ODBC connection...
Quite long-winded but should work!
-
August 22nd, 2003, 09:16 AM
#9
or, also...
Lothar "theGreat" Haensler gave an Api solution to this matter:
http://www.codeguru.com/vb/articles/1915.shtml
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 22nd, 2003, 09:23 AM
#10
Re: or, also...
Originally posted by Cimperiali
Lothar "theGreat" Haensler gave an Api solution to this matter:
& much more elegant solution than mine...!!
-
August 22nd, 2003, 09:28 AM
#11
Oh, you know...
...Lothar is Lothar.
Once here we had a Top Ten based on points everybody could assign to answers...Lothar had stored so many points that he staied at Top of Top for more than one year after he left CodeGuru...
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 23rd, 2003, 02:47 AM
#12
Thank you !!!
Iam using "Lothar Haensler API" currently.
And also Iam trying with using the COM object. (to know the Core) it might help me in another cases also..
Once again, thanks for the Share of Knowledge.
bye
Soundar
your's
Soundar
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|