I have VB code that uses ADOX to create Access mdb files. I am successfully
importing all types of modules - forms, reports, queries, code modules, and
class modules.
I am having trouble setting the Startup Options of the Access mdb file.
Here's the code:
coACApp.CurrentDb.Properties("AppTitle") = Trim(oRS!CRASO_Value)
If Err.Number = PROPERTY_NOT_FOUND Then
Err.Clear
Set oProp = coACApp.CurrentDb.CreateProperty("AppTitle", TEXT_TYPE, Trim(oRS!CRASO_Value))
coACApp.CurrentDb.Properties.Append oProp
End If
This is based on an MSDN article. The code works like I would expect it
to. The first line generates a 3270 error, which is trapped on the next
line and the property is supposedly appended. oProp is defined as a simple
object in the DIM statement. Not sure if this late binding is a source of
my problems.
If I execute the code without this function, the mdb file is created and
everything is OK. If I execute my Startup Option function and try to set
the fields, the mdb file is created without errors. However, when opening
any mdb file that has this code run against it, becomes corrupted and shuts
Access down.
Sorry for the long email, but this is the last piece to completing this project.
Thx.
CR