PC Review


Reply
Thread Tools Rate Thread

[ADO.Net, Access 97] how to determine the exact type of DateTime column

 
 
scj
Guest
Posts: n/a
 
      14th Oct 2003
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...




 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      14th Oct 2003
* "scj" <(E-Mail Removed)> scripsit:
> I need to determine the exact type of DateTime column(*) in an Access 97
> database.


Why not post this question to the ADO.NET group?

<news://msnews.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<http://msdn.microsoft.com/newsgroups/default.asp?url=/newsgroups/loadframes.asp?icp=msdn&slcid=us&newsgroup=microsoft.public.dotnet.framework.adonet>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting database column data type of smalldatetime vs. datetime? Jen Microsoft ADO .NET 3 8th Aug 2007 08:44 AM
[ADO.Net, Access 97] how to determine the exact type of DateTime column scj Microsoft Access 11 16th Oct 2003 12:10 PM
[ADO.Net, Access 97] how to determine the exact type of DateTime column scj Microsoft C# .NET 1 14th Oct 2003 05:23 PM
[ADO.Net, Access 97] how to determine the exact type of DateTime column scj Microsoft ADO .NET 0 14th Oct 2003 04:22 PM
[ADO.Net, Access 97] how to determine the exact type of DateTime column scj Microsoft Dot NET Framework 0 14th Oct 2003 04:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:30 AM.