[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Paul Clement

7/6/2004 9:40:00 PM

On Thu, 1 Jul 2004 16:36:01 -0700, "Enzo" <enzomaini@dotnetfan.net> wrote:

¤ The following code:
¤
¤ ADOX.Catalog mdb = new ADOX.CatalogClass();
¤ try
¤ {
¤ mdb.Create("Provider=Microsoft.Jet.OLEDB.4.0;" +
¤ "Data Source=" + mdbPath + @"\" + mdbName + ";" +
¤ "Jet OLEDB:Engine Type=5");
¤
¤ ADOX.Table mdbTbl = new ADOX.TableClass();
¤ mdbTbl.Name = "Receivers";
¤ mdbTbl.Columns.Append("AddressBookID", ADOX.DataTypeEnum.adDecimal,9);
¤ mdb.Tables.Append(mdbTbl);
¤ }
¤ catch(Exception ex)
¤ {
¤ Trace.WriteLine(ex.Source);
¤ Trace.WriteLine(ex.Message);
¤ Trace.WriteLine(ex.InnerException);
¤ }
¤
¤ This code throws an exception telling me that it is an invalid type. But I am using the the ADOX Enum so what is the problem?

adDecimal does not map to an Access data type. Try adCurrency instead. If this isn't the correct
data type you may want to indicate what the data type of the column is when viewing in Access.


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)