|
-
Jul 13th, 2006, 07:13 PM
#1
Thread Starter
Lively Member
[RESOLVED] Error when Updating Database
Hi, I'm using:
VB 6.0
Microsoft Access 2000 - 9.0
-----------------------------------------------------------
I have a form which interacts with my database, the form
is currently working great at pulling up records, displaying
information, etc...
My Problem occurs, whenever I attempt to "edit" or "update"
a record. If I completely delete the information in a record's field,
and leave the field blank... I get the following error:
Run-time error '-2147217887 (80040e21)':
Multiple-step operation generated errors. Check each status value.
Is there any way to blank-out / delete the information in a record's field
without generating an error?
Thanks!!!
-
Jul 14th, 2006, 02:18 AM
#2
Addicted Member
Re: Error when Updating Database
There are several possible reasons.
Are you using a recordset that gets data from than one table and then you try to delete with rs.delete method?
Please paste the line of code that fires the error, we'll solve your problem.
Using Visual Basic 6.0, access 2000, Visual Studio 2005
Rate the post that you approve 
-
Jul 14th, 2006, 08:15 AM
#3
Thread Starter
Lively Member
Re: Error when Updating Database
Thanks for the reply!!!
Here's more background... I'm using the adodc control on the form, with the Text Boxes tied to the Database Table through the properties section in VB.
For example, let's say I have a Table in Access with a record where:
Field1 = 5
Field2 = 10
Now, when i select this record in my form... and delete the values in Field1 and Field2 (so now both fields are blank) I get the error.
VB does let me change the values to a different number & update... just won't let me make the fields BLANK.
My code is very basic, with the "update" portion looking like this:
-------------------------------------
Private Sub cmdSave_Click()
datTable.Recordset.Update
End Sub
-------------------------------------
When the error pops up, I hit "Debug" and VB highlights the datTable.Recordset.Update line of code.
Thanks for any advice/help!!!
-
Jul 14th, 2006, 08:37 AM
#4
Re: Error when Updating Database
I'm using the adodc control
there is a thread in the Database FAQ's (link below) which explains why that is a bad idea.
Anyway, on to the problem in this case.. it sounds to me as if you have not set up the database appropriately for your needs.
As you want to have the fields blank, you have to go into the table design, and ensure that "required" is set to No, and possibly "allow zero length" is set to Yes (for text fields).
If that doesn't correct it, let us know what data type the fields are.
-
Jul 14th, 2006, 08:54 AM
#5
Thread Starter
Lively Member
Re: Error when Updating Database
I'm still getting the error...
As for my database table, the fields are set-up as:
Data Type: Number
Field Size: Single
Format: General Number
All numbers entered by the user on the form are between 1-20. (no decimals)
So, still getting error when attempting to edit an existing record... where any fields with a value are deleted to be BLANK.
Thanks!
-
Jul 14th, 2006, 08:59 AM
#6
Re: Error when Updating Database
Ok.. can you make the fields blank (manually) in Access?
-
Jul 14th, 2006, 10:00 AM
#7
Thread Starter
Lively Member
Re: Error when Updating Database
Yes... I can make fields blank in Accesss and save the table with no problems.
-
Jul 14th, 2006, 10:04 AM
#8
Re: Error when Updating Database
In that case it sounds like an issue with the binding to the textboxes, or the Data Control itself. I'm afraid that I have no idea what the problem might be, or how to correct it tho.
-
Jul 14th, 2006, 10:11 AM
#9
Thread Starter
Lively Member
Re: Error when Updating Database
Thank you Si for your attention in this matter.
I'm going to redo the entire form, using code instead of the adodc... and hopefully I'll figure out the issue during the process.
I'll mark resolved to close this thread...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|