Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too many Fields Defined Error 3190

Status
Not open for further replies.

MePenguin

Technical User
Oct 31, 2003
107
0
0
SE
Can anybody tell me why I'm getting this in the following code when the number of fields is greater than about 70?

Code:
For Each fld In rs.Fields
    If fld.name <> "CODE" And fld.name <> "Species Name" Then
        SQLText = "ALTER TABLE BugsCountsheet ALTER COLUMN [" & fld.name & "] long;"
        DoCmd.RunSQL SQLText
    End If
Next fld
the error is occuring on the DoCmd.RunSQL SQLText.

It's part of a large import, reformat, export routine, and works perfectly well for excel files with less than about 70 columns.

Is this the mysterious form lifetime controls limit???

Thanks,

Phil

Phil

---------------
Pass me the ether.
 
may be
[tt]
For Each fld In rs.Fields
If fld.name <> "CODE" Or fld.name <> "Species Name" Then
SQLText = "ALTER TABLE BugsCountsheet ALTER COLUMN [" & fld.name & "] long;"
DoCmd.RunSQL SQLText
End If
Next fld
[/tt]

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
zmr,
I think the "or" is not what he'd want, then it'd change both the "CODE" and "Species Name" fields.

I'm not sure the alter table syntax is correct either, phil. Is this a Jet table?
--Jim
 
Sorry, I missed a bit of background out.
It's an Access 2000 database, and the table is local (not linked), created using the transferspreadsheet method - I'll have to post the code this evening (CET).

You're right Jim, I need the 'or' (sorry Abdulla).

The systax works fine up to about 70 fields. I'm wondering whether I need to close the active form and run this part of the code from a separate module. If this didn't solve it, it would at least allow me to eliminate the 'form lifetime controls limit' problem...

Any thoughts? An alternative method for altering the field datatype?

Thanks,


Phil

---------------
Pass me the ether.
 
Thank's for the tip. Useful.


Phil

---------------
Pass me the ether.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top