vishalmarya
Programmer
- Aug 19, 2001
- 28
I am trying to create a new table in mdb file.
Here is the code
''**********************
Dim cn As New ADODB.Connection
Dim cat As New ADOX.Catalog
Dim otable As New ADOX.Table, ocol As New ADOX.Column
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\test.mdb"
cat.ActiveConnection = cn
otable.Name = "newtable"
cat.Tables.Append otable
ocol.Name = "fld1"
ocol.Type = adVarWChar
ocol.DefinedSize = 100
otable.Columns.Append ocol
ocol.Properties(2) = "Test description" '' description prop
ocol.Properties(13) = True '' Allow zero length prop
ocol.Properties(3) = True '' Required prop
''**********************
following error is generated in Last statement :
"Multiple-step OLE DB operation generated errors. Check each OLE DB Status value, if available. No work was done.
Here is the code
''**********************
Dim cn As New ADODB.Connection
Dim cat As New ADOX.Catalog
Dim otable As New ADOX.Table, ocol As New ADOX.Column
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\test.mdb"
cat.ActiveConnection = cn
otable.Name = "newtable"
cat.Tables.Append otable
ocol.Name = "fld1"
ocol.Type = adVarWChar
ocol.DefinedSize = 100
otable.Columns.Append ocol
ocol.Properties(2) = "Test description" '' description prop
ocol.Properties(13) = True '' Allow zero length prop
ocol.Properties(3) = True '' Required prop
''**********************
following error is generated in Last statement :
"Multiple-step OLE DB operation generated errors. Check each OLE DB Status value, if available. No work was done.