newbie Runtime error 3259: Invalid Field Data Type 
Author Message
 newbie Runtime error 3259: Invalid Field Data Type

i'm a newbie so the chances are high that this is a stupid problem.
but i'm trying to create a database but i get the runtime error noted
in the subject. i get the error on the last line (prior to End Sub,
that is). all of the "existing file" stuff is just to make sure the
file is gone, to avoid "already exists" errors. please let me know
what i did wrong...any help is appreciated.

Private Sub mnuFileNew_Click()
    Dim dbTome As Database, wspTome As Workspace
    Dim tbdTome As TableDef
    Dim fldTitle As Field, fldCost As Field, fldType As Field, fldText
As Field, fldPT As Field
    Dim ExistingFile

    ExistingFile = dir("d:\practice.mdb")

    If Len(ExistingFile) <> 0 Then Kill "d:\practice.mdb"

    Set wspTome = DBEngine.Workspaces(0)
    Set dbTome = wspTome.CreateDatabase("d:\practice.mdb",
dbLangGeneral, dbVersion30)
    Set tbdTome = dbTome.CreateTableDef("Tome")
    Set fldTitle = tbdTome.CreateField("Title")
    Set fldCost = tbdTome.CreateField("Cost")
    Set fldType = tbdTome.CreateField("Type")
    Set fldText = tbdTome.CreateField("Text")
    Set fldPT = tbdTome.CreateField("PT")

    tbdTome.Fields.Append fldTitle
    tbdTome.Fields.Append fldCost
    tbdTome.Fields.Append fldType
    tbdTome.Fields.Append fldText
    tbdTome.Fields.Append fldPT
    dbTome.TableDefs.Append tbdTome
End Sub

-----
To mail me, change "com" to "net".



Wed, 29 Nov 2000 03:00:00 GMT
 newbie Runtime error 3259: Invalid Field Data Type

I'm not sure, but I think that you have to inclue the field data type in the
createfield.    You also have to append the new table and field to the
collection before it is included in the DB.  Check out the example in the
help file under CreateNew Field.  I kinda cover what your doing.

J



Thu, 30 Nov 2000 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. error 3259 Invalid Field Data Type

2. Field type to use when data contains invalid dates

3. Invalid Data Field Type

4. invalid data type error SQL to Access

5. "Runtime Error 13 Data Type mismatch"

6. Runtime error when retrieving Ingres Money data type

7. Data type conversion error when saving numeric data types

8. Money field type same as Currency data type??

9. Data Type Errors when converting an empty field to a number

10. Data Type transparent to the type of the table field

11. Data Type Conversion Error with Long Binary Field -PLEASE HELP

12. Help with Runtime error 380 (Invalid property Value)


 
Powered by phpBB® Forum Software