how to correct create db with following fields:
Dim F As String
Dim S As Long
Dim T As Integer
Dim C As Double //Currency
Dim D As String //Date
F = "ABC"
S = 88869045
T = 9
C = 30.4493 // currency, but can be double
D = "06.08.2010" // date (how to correct convert to date?) //#1
DBTable.Name = "TestTable"
DBTable.Columns.Append "First", adVarWChar, 40
DBTable.Columns.Append 1, adBigInt, 20
DBTable.Columns.Append 0, adInteger
DBTable.Columns.Append 0, adCurrency
DBTable.Columns.Append 0, adDate
DBCatalog.Tables.Append DBTable
also, DBCatalog as ADOX.Catalog and DBTable as ADOX.Table.
see also additional question at #1.
Thanks!
If your Access version is 2000 or later, you can use the
Replace()function to substitute dashes for the dots in your date string. Then theCDate()function will be able to convert the string to a Date/Time value.That was an example from the Immediate window on my system, which uses US as its locale setting. So
CDate()can accept a string containing a date in mm-dd-yyyy format. If your locale is different, you will need to put in more work to get what you need.