ADOX help

wildbeliefs
12-18-2003, 10:07 AM
Hey,

I'm trying to create a db through code and am running into some problems with setting some attributes, like defaults. Here's my code where the table is created:


'Deck Table''''''''''''''''''''''''''''''''''''''
With Deck
Set .ParentCatalog = objcat
.Name = "Deck"
.Columns.Append "ProjectID", adVarWChar, 50
.Columns.Append "DeckName", adVarWChar, 50
.Columns.Item("Deckname").Properties.Item("default") = "***"
.Columns.Item("ProjectID").Attributes = adColNullable
End With
objcat.Tables.Append Deck


I get the error: "Application uses a value of the wrong type for the current operation"

Anybody know what's wrong? Is it the syntax?

wildbeliefs
12-21-2003, 08:40 PM
I fixed my problem. In case anyone in the future has a similar problem with setting defaults in ADOX, the reason is this:

- There's nothing wrong with the syntax; it's a bug in MDAC. This bug has been fixed in MDAC v2.6 RTM (and above), so if you get errors when trying to set a default in a column in ADOX, just update your MDAC.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum