Were you able to figure out how to do this?
I am having the same problem. I found the solution below; however, it does not work:
I have a vb app that utilizes msaccess. when the app is upgraded, the db, at times, will change to include additional fields in the table. I do not want to include a new database, but dynamically change the existing database located on the users PCs.
Here is what I found, but it does not work as it gives me an error: "arguments are of the wrong type, are out of acceptable range, or are in conflict with one another".
////////////////////////////////////////
Dim fileName
Dim File As ADODB.Recordset
Dim Cnxn As ADODB.Connection
Dim strCnxn As String
Set Cnxn = New ADODB.Connection
Set File = New ADODB.Recordset
fileName = "c:/folder/filename.ext"
With Cnxn
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & fileName & ";" & _
"Mode=ReadWrite|Share Deny None;Persist Security Info=False"
.Open
End With
MsgBox ("Add fields to a database")
File.Fields.Append "PlayNull", adBoolean, 1, adFldUpdatable, False
MsgBox ("status for the fields")
MsgBox (File.Fields("PlayNull").Status) 'adfldpendinginsert
'turn off error-handling to verify field status
On Error Resume Next
File.Fields.Update
MsgBox ("Update succeeds")
MsgBox (File.Fields("PlayNull").Status) 'adfldpendinginsert + adFieldUnavailable
' resume default error-handling
On Error GoTo 0
' clean up
Cnxn.Close
Set File = Nothing
Set Cnxn = Nothing
Your assistance would be greatly appreciated.
BTW: ADOX has a great solution, but i cannot use it.