Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...