How to dynamically create access database with date field having custom date format?
<p>Can anyone please help me on my current problem?</p>

<p>I am doing a project that dynamically creates access database (.mdb file). the database have a date field but I want it to have custom date format.</p>

<p>Here is what I have so far.</p>

<pre><code>Dim con As New OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source =" &amp; databaseName)
        con.Open()
        Dim dbSchema As DataTable = con.GetOleDbSchemaTable(OleDb.OleDbSchemaGuid.Tables, _
                                                            New Object() {Nothing, Nothing, tableName, "TABLE"})
        con.Close()
        If dbSchema.Rows.Count &gt; 0 Then
'I have some code here
        Else
'This is where I create the table
            Dim cmd As New OleDb.OleDbCommand("CREATE TABLE [" + tableName + "] ([Meter] TEXT(2), [Name] TEXT(20), " _
                                              &amp; "[Element1] TEXT(20), [Element2] TEXT(20), [Element3] TEXT(20), [W] TEXT(20), " _
                                              &amp; "[pf] TEXT(20), [kWh_Delivered] TEXT(20), [kWh_Received] TEXT(20), " _
                                              &amp; "[Date_Time] Date(mm/dd/yyyy hh:nn:ss))", con)
            cmd.ExecuteNonQuery()
            con.Close()
            MessageBox.Show("Table Created Successfully")

        End If
</code></pre>

<p>Thanks!</p>