S
scj
Hi all,
I need to determine the exact type of DateTime column(*) in an Access 97
database.
I'm able to do this with an Access 2 database.
With ADO.Net and VB.Net, I do something like this :
Dim oDT As New DataTable()
Dim oCnx As OleDbConnection
Dim oGUID As New OleDbSchemaGuid()
....
oCnx = New OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=xxx.mdb;Persist Security Info=False" )
oCnx.Open()
....
oDT = oCnx.GetOleDbSchemaTable( oGUID.Columns, New Object() { Nothing,
Nothing, "TABLE_NAME" } )
....
Then, the column :
- "DATA_TYPE" gives the type
- "COLUMN_FLAGS" gives me more information
With Access 2, "DATA_TYPE" is "7" for a date and "COLUMN_FLAGS" is "90" for
a DateTime or something else for just a Date.
The problem with Access 97 is that the "COLUMN_FLAGS" is the same with both
Date and DateTime.
I tryed to use system tables, with the hope to find a table with table
structure and excat column type, but without succes.
Thanks for all assistance,
Marc
(*) A DateTime can store date, time, datetime, etc...
I need to determine the exact type of DateTime column(*) in an Access 97
database.
I'm able to do this with an Access 2 database.
With ADO.Net and VB.Net, I do something like this :
Dim oDT As New DataTable()
Dim oCnx As OleDbConnection
Dim oGUID As New OleDbSchemaGuid()
....
oCnx = New OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=xxx.mdb;Persist Security Info=False" )
oCnx.Open()
....
oDT = oCnx.GetOleDbSchemaTable( oGUID.Columns, New Object() { Nothing,
Nothing, "TABLE_NAME" } )
....
Then, the column :
- "DATA_TYPE" gives the type
- "COLUMN_FLAGS" gives me more information
With Access 2, "DATA_TYPE" is "7" for a date and "COLUMN_FLAGS" is "90" for
a DateTime or something else for just a Date.
The problem with Access 97 is that the "COLUMN_FLAGS" is the same with both
Date and DateTime.
I tryed to use system tables, with the hope to find a table with table
structure and excat column type, but without succes.
Thanks for all assistance,
Marc
(*) A DateTime can store date, time, datetime, etc...