How Do I Correct a Zero-Length string error?

I cannot figure out a Zero-String error on my web page. I am using an Access database for my Table and the Web page is an ASP page.
Below is the error message along with the line of code for the desired records. In the code, how do I correct the 'City" field.?
If the user does not enter anything in the field, the field should respond with a blank display.

Thank you for any help!
Rick

ERROR
insert into CAR (EditBy,Status,DateIssued,[Issued by],Title,Company,Contact,Phone,Fax,Email,Manufacturer,[Part Number],[ESC ID],PO,RMA,[Quantities Affected],[Description of Nonconformance],Containment,[Root Cause],CandP,[Corrective Action Date],[Due Date],[Reference Number],Address1,Address2,City,State,Zip,CityStateZip,Quan1,Lot1,Quan2,Lot2,Quan3,Lot3,Branch,ClosedDate,CompletedBy,ToFrom,ReviewOfEffectiveness) values ('BECKYS','Closed',NULL,'BECKYS','','','','','','','','','','','','','','','','',NULL,NULL,'','','','','','','','','','','','','','',NULL,'BECKYS','From: ES Components',NULL)
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Field 'CAR.City' cannot be a zero-length string.
/AllCARAdds.asp, line 79

CODE
var MM_fieldsStr = "select1|value|select2|value|DateIssued|value|select3|value|Title|value|Company|value|Contact|value|Phone|value|Fax|value|Email|value|Manufacturer|value|PartNumber|value|ESCID|value|PO|value|RMA|value|QuantityAffected|value|Nonconformance|value|Containment|value|RootCause|value|CandP|value|CorrectiveActionDate|value|DueDate|value|ReferenceNumber|value|Address1|value|Address2|value|City|value|State|value|Zip|value|CityStateZip|value|Quan1|value|Lot!|value|Quan2|value|Lot2|value|Quan3|value|Lot3|value|Branch|value|CloseDate|value|select4|value|select5|value|ReviewofEffectiveness|value";
  var MM_columnsStr = "EditBy|',none,''|Status|',none,''|DateIssued|',none,NULL|[Issued by]|',none,''|Title|',none,''|Company|',none,''|Contact|',none,''|Phone|',none,''|Fax|',none,''|Email|',none,''|Manufacturer|',none,''|[Part Number]|',none,''|[ESC ID]|',none,''|PO|',none,''|RMA|',none,''|[Quantities Affected]|',none,''|[Description of Nonconformance]|',none,''|Containment|',none,''|[Root Cause]|',none,''|CandP|',none,''|[Corrective Action Date]|',none,NULL|[Due Date]|',none,NULL|[Reference Number]|',none,''|Address1|',none,''|Address2|',none,''|City|',none,''|State|',none,''|Zip|',none,''|CityStateZip|',none,''|Quan1|',none,''|Lot1|',none,''|Quan2|',none,''|Lot2|',none,''|Quan3|',none,''|Lot3|',none,''|Branch|',none,''|ClosedDate|',none,NULL|CompletedBy|',none,''|ToFrom|',none,''|ReviewOfEffectiveness|',none,NULL";
ES-ComponentsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lee W, MVPTechnology and Business Process AdvisorCommented:
It sounds like city is a required field but you are not validating the data. I'd validate there is data in the field (if Len(CAR.CityDataVariable) < 1 Then ...)

If you don't care about there being data in the field, then change the field requirements so it can be empty or null.

If you don't want to do it the right way with one of the two options above, then just do a check and alter the value programmatically so that if the len < 1 then the variable = "N/A" or something like that.
0
_agx_Commented:
In addition to what Lee said, looks like the "wizard" code replaces "none" with an empty string. So you'd have to search the delimited MM_fieldsStr  variable again, find the "city" and replace none with some other default value like N/A.

             var MM_fieldsStr = "Status|value|........|City|',none,''|

BTW, this kind of stuff demonstrates why wizard generated code is both a blessing an a curse (...when you need to change things).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ES-ComponentsAuthor Commented:
AGX solved the problem. I also found out that by going into the Access database table in the City field, just change the default setting to
allow Zero-String. Thanks AGX for your help!!!!!
0
_agx_Commented:
Glad you got it working. Just for the record, the other half of the solution (altering the database table) was Lee W, MVP's suggestion, so for next time a split would be appropriate :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.