Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Error Field 'ESCContactsTable.City' cannot be a zero-length strin


Message #1 by "Nadia Hamza" <hamzan@h...> on Wed, 16 Aug 2000 0:6:2
Hi,



I'm getting the following error when I'm trying to add a new record to a 

database.Microsoft OLE DB Provider for ODBC Drivers error '80004005'



[Microsoft][ODBC Microsoft Access Driver] Field 'ESCContactsTable.City' 

cannot be a zero-length string.



/ESCTest/AddNew.asp, line 86 



I'm getting information from a form and adding it to a table; however, 

certain fields from the form might be blank.  I've got a solution that will 

work by using If statements like this:

        If years<>"" Then

            objRec("YearsAtESC") = years

        End If



However, I have quite a few fields and was wondering if there is another 

solution that might be more efficient.



Thanks in advance,



Nadia







Message #2 by "Ken Schaefer" <ken@a...> on Wed, 16 Aug 2000 18:34:37 +1000
I think you need to re-examine your database design.



If the user *must* fill in these fields, you shouldn't allow them to leave

the fields blank in the first place.



If the user is allowed to leave the fields blank, then change the setup of

the database to allow zero-length fields...



Cheers

Ken



----- Original Message -----

From: "Nadia Hamza" 

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, August 16, 2000 12:00 AM

Subject: [asp_databases] Error Field 'ESCContactsTable.City' cannot be a

zero-length strin





> Hi,

>

> I'm getting the following error when I'm trying to add a new record to a

> database.Microsoft OLE DB Provider for ODBC Drivers error '80004005'

>

> [Microsoft][ODBC Microsoft Access Driver] Field 'ESCContactsTable.City'

> cannot be a zero-length string.

>

> /ESCTest/AddNew.asp, line 86

>

> I'm getting information from a form and adding it to a table; however,

> certain fields from the form might be blank.  I've got a solution that

will

> work by using If statements like this:

>         If years<>"" Then

>             objRec("YearsAtESC") = years

>         End If

>

> However, I have quite a few fields and was wondering if there is another

> solution that might be more efficient.

>

> Thanks in advance,

>

> Nadia



Message #3 by "JOHN P. PARLATO" <jparlato@m...> on Wed, 16 Aug 2000 07:34:49 -0700
Try making the fields nullable in the data base table definition.



----- Original Message -----

From: Nadia Hamza 

To: ASP Databases <asp_databases@p...>

Sent: Wednesday, August 16, 2000 12:00 AM

Subject: [asp_databases] Error Field 'ESCContactsTable.City' cannot be a

zero-length strin





> Hi,

>

> I'm getting the following error when I'm trying to add a new record to a

> database.Microsoft OLE DB Provider for ODBC Drivers error '80004005'

>

> [Microsoft][ODBC Microsoft Access Driver] Field 'ESCContactsTable.City'

> cannot be a zero-length string.

>

> /ESCTest/AddNew.asp, line 86

>

> I'm getting information from a form and adding it to a table; however,

> certain fields from the form might be blank.  I've got a solution that

will

> work by using If statements like this:

>         If years<>"" Then

>             objRec("YearsAtESC") = years

>         End If

>

> However, I have quite a few fields and was wondering if there is another

> solution that might be more efficient.

>

> Thanks in advance,

>

> Nadia

>

>

>

>

> ---

> You are currently subscribed to asp_databases


$subst('Email.Unsub')

>




  Return to Index