cyberbiker
Programmer
I statrted a new thread even though this is very much related to another one I had started, so I apologize if I am wrong but I think there is enough difference in what I need to make starting a new thread advisable.
I am modifying existing code to change from ACCESS 97 tables (Jet) to SQL Server 7 tables using ODBC Direct instead of ADO
The current code uses TableDefs a few places.
I think I have fumbled through things and studied the help menu enough to handle all i need for now except how to determine when a table was last updated.
The following function is currently in use and does what is needed:
Function pfRackListRecent() As Integer
' Checks if the current rack list was recently generated
Dim db As Database, td As TableDef, sec As Variant
(above line db will be changed to dim db as connection)
On Error Resume Next
Set db = DBEngine(0)(0)
db.TableDefs.Refresh
Set td = db.TableDefs(pcRACKLISTNAME)
sec = DateDiff("s", td.LastUpdated, Now)
pfRackListRecent = (ERR = 0 And sec < 120)
End Function
What I need to find out is how do I do the same thing with SQL server?
I have waded through the help (along with a couple of books I have here) and think that I need to use the lastprocessed property of the dimension interface. But I seem to be missing something. I just do not understand what I am reading. I suspect I have missed some basic concept.
Would I do something like this?
(pcRACKLISTNAME is a string assigned the name of a table )
Function pfRackListRecent() As Integer
' Checks if the current rack list was recently generated
Dim db As Connection, sec As Variant
Dim dsoTest As DSO.Dimension
On Error Resume Next
Set db = DBEngine(0)(0)
Set dsoTEST = db.Dimensions.AddNew(pcRACKLISTNAME)
If dsotest.State <> olpaStateNeverProcessed Then
sec = DateDiff("s", dsotest.last processed, Now)
End If
End If
pfRackListRecent = (ERR = 0 And sec < 120)
End Function
Any help would be appreciated greatly. I truly do not understand this part at all
Terry (cyberbiker)
I am modifying existing code to change from ACCESS 97 tables (Jet) to SQL Server 7 tables using ODBC Direct instead of ADO
The current code uses TableDefs a few places.
I think I have fumbled through things and studied the help menu enough to handle all i need for now except how to determine when a table was last updated.
The following function is currently in use and does what is needed:
Function pfRackListRecent() As Integer
' Checks if the current rack list was recently generated
Dim db As Database, td As TableDef, sec As Variant
(above line db will be changed to dim db as connection)
On Error Resume Next
Set db = DBEngine(0)(0)
db.TableDefs.Refresh
Set td = db.TableDefs(pcRACKLISTNAME)
sec = DateDiff("s", td.LastUpdated, Now)
pfRackListRecent = (ERR = 0 And sec < 120)
End Function
What I need to find out is how do I do the same thing with SQL server?
I have waded through the help (along with a couple of books I have here) and think that I need to use the lastprocessed property of the dimension interface. But I seem to be missing something. I just do not understand what I am reading. I suspect I have missed some basic concept.
Would I do something like this?
(pcRACKLISTNAME is a string assigned the name of a table )
Function pfRackListRecent() As Integer
' Checks if the current rack list was recently generated
Dim db As Connection, sec As Variant
Dim dsoTest As DSO.Dimension
On Error Resume Next
Set db = DBEngine(0)(0)
Set dsoTEST = db.Dimensions.AddNew(pcRACKLISTNAME)
If dsotest.State <> olpaStateNeverProcessed Then
sec = DateDiff("s", dsotest.last processed, Now)
End If
End If
pfRackListRecent = (ERR = 0 And sec < 120)
End Function
Any help would be appreciated greatly. I truly do not understand this part at all
Terry (cyberbiker)