This is doing my crust in!
I've found loads of web sites that tell me how to create an accdb file from within VB.Net 2010.
I've written this function which creates the file and I can open it in Access 2010.
*HOWEVER*
When I open it, the first thing Access does is "repair" it, then it opens it as 2002/2003 format!!
What on earth is going on?
I have a reference to MS ADO Ext 6.0 for DDL and security...
Code:
Imports ADODB
Imports System.IO
Imports Microsoft.VisualBasic
Module modADO
Public Function CreateDB(ByVal sDBpath As String) As Boolean
Dim bRET As Boolean = True
'Add a reference to ADOX (Microsoft ADO Ext. 6.x for DDL and Security)
Dim ADOXcatalog As New ADOX.Catalog
Try
ADOXcatalog.Create("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & sDBpath & "myAccess2007file.accdb;Jet OLEDB:Engine Type=5;")
Catch ex As Exception
Debug.Print(ex.ToString)
bRET = False
End Try
ADOXcatalog = Nothing
Return bRET
End Function
End Module