joe_pool_is Posted July 29, 2004 Posted July 29, 2004 I am collecting data from a form (finally got the sucker to work!) and posting that data into a small MS Access database. My SQL statement is: INSERT INTO [/font] [font=Tahoma]Customer1([/font] [font=Tahoma]FirstName, LastName, Address, City,[/font] [font=Tahoma]State, Zip, Phone, IDType,[/font] [font=Tahoma]IDNum, DOB, ServAddr, ServCity,[/font] [font=Tahoma]ServState, ServZip, SSN, Email,[/font] [font=Tahoma]CableTV, SatTV, Electric, IAuto,[/font] [font=Tahoma]IHome, ILife, IMed, IRent,[/font] [font=Tahoma]CallID, CallWait, CallFWD, WaitID,[/font] [font=Tahoma]3Way, VM, LongDist, DialUp,[/font] [font=Tahoma]DSL)[/font] [font=Tahoma]VALUES ([/font] [font=Tahoma]'Joe', 'Pool', '1819 Wisteria Road', 'Richardson',[/font] [font=Tahoma]'TX - TEXAS', '75080', '972-555-0881', 'Military',[/font] [font=Tahoma]'888', '09/21/1979', '1819 Wisteria Road', 'Richardson',[/font] [font=Tahoma]'TX - TEXAS', '75080', '123456789', 'jp8mail-spam@yahoo.com',[/font] [font=Tahoma]False, False, False, True,[/font] [font=Tahoma]False, False, False, True,[/font] [font=Tahoma]True, False, False, False,[/font] [font=Tahoma]False, False, True, False,[/font] [font=Tahoma]False); When I tried my ExecuteNonQuery() call, I got the following Exception: ?ex.Message[/font] [font=Tahoma]"The field is too small to accept the amount of data you attempted to add. [/font] [font=Tahoma]Try inserting or pasting less data." What does this mean? What "field"? Does Access only accept SQL strings of a certain length? Is there a better way to add this single record? Now, in my Access database, I do have some fields set to certain formats: Phone's format is "(999) 999-9999" and SSN's format is "999-99-9999". Other formats are either Text fields or Yes/No (boolean) fields. Could these formats be causing problems? Does Access require Yes for True and No for False? Thanks for helping! Quote Avoid Sears Home Improvement
Administrators PlausiblyDamp Posted July 29, 2004 Administrators Posted July 29, 2004 (edited) What length of text are you allowing for the text related fields? If they are set smaller than the data you are passing in then this error will occur. Edited March 30, 2007 by PlausiblyDamp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
joe_pool_is Posted July 29, 2004 Author Posted July 29, 2004 I think that will fix it. I see now where I have my Text field for State set to 2 characters. Doh! Thanks, PlausiblyDamp! Quote Avoid Sears Home Improvement
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.