Append method error

J

JonWayne

I use the following code snippet to create a table in an external database,
add 20 fields, and append the table to the tabledefs collection. The append
method fails with the message: Too many fields defined (3190). As you will
see, the table structure is identical to a table in the local database. Why
am I getting this message? Anyone pleeeeease help.

If RemoteTdf Is Nothing Then
Set RemoteTdf = RemoteDb.CreateTableDef(Tbl5)
RemoteDb.TableDefs.Refresh
Set LocalTdf = LocalDb.TableDefs(Tbl5)

For Each Fld In LocalTdf.Fields
Set Fld2 = RemoteTdf.CreateField(Fld.Name, Fld.Type)
If Fld.Type = dbText Then Fld2.Size = Fld.Size
RemoteTdf.Fields.Append Fld2
'x = x + 1
Next Fld

'MsgBox x
RemoteTdf.Connect = ";DATABASE=" & MainPath & Cty & "\" &
Cty & ".mdb;"
RemoteTdf.SourceTableName = Tbl5
RemoteDb.TableDefs.Append RemoteTdf
RemoteDb.TableDefs.Refresh
RemoteTdf.RefreshLink

ElseIf RemoteTdf.Connect = "" Then ....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top