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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft OLE DB Provider for ODBC Drivers error '80040e21' 1

Status
Not open for further replies.

Slippenos

MIS
Apr 22, 2005
333
US
I get this error

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

When I attempt to update a table within my database with a null 'Yes/No' field.

My html code is as follows:
Code:
<input type = "checkbox" name = "Sample" value=1>

And the field properties are set to Yes/No | On/Off

I cannot set the MSAccess field to 'allow zero-lengths'.

How can I submit my form will null Yes/No fields?
 
Did you try setting the default value to 'No' ??
 
I changed the format to read 'Yes/No' and I changed the default value to No ... to no avail.

Any other suggestions?
 
Are you sure it is a problem with this particular field?

Does your code work OK if it is not null? Lets see the part of the code where you interact with the database.
 
Code:
<%

Set Rs = Server.CreateObject( "ADODB.Recordset" )
Rs.Open "tblDataRequests", "MikeyDRF", adOpenKeySet, adLockPessimistic, adCmdTable
Rs.AddNew

Code:
Rs( "Sample" ) = Request.Form( "Sample" )

Code:
Rs.Update
Rs.Close
Set Rs = Nothing

%>
 
Try this:
Code:
IF Len(Request.Form("Sample")) > 0 THEN
  Rs( "Sample" ) = Request.Form( "Sample" )
END IF

Or this:
Code:
Rs( "Sample" ) = CBool(Request.Form("Sample"))
 
They both worked as I wished. Thank you very much. If I might ask, though ..

What does the Cbool method do?

-Mike
 
I'm glad it worked out for you and thanks for the star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top