Creating an Access database in VB.NET
Posted on 2005-03-02
I have been able to create an Access DB in VB.NET using ADOX, but have some quick questions about it. The code I used to create the database follows the questions.
1. I have been unable to give the database a password when creating it. I thought I could simply add "; Password='test'" to the connection string, but this doesn't work. How can I do it?
2. I have found that if I have too many fields (columns) in a table, I am unable to execute SQL statements on it. Is there any way around this restriction?
Sub Create_Program_Defaults(ByVal DefaultsFilePathName As String)
' Create the database file
Dim cat As ADOX.Catalog
cat = New ADOX.Catalog
Dim connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & DefaultsFilePathName
cat = Nothing
' Create the Program Defaults table