•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 373,936 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,724 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 380 | Replies: 3
![]() |
•
•
Join Date: Jun 2007
Location: india /bangalore
Posts: 18
Reputation:
Rep Power: 2
Solved Threads: 0
i have typed this code within my form..
////and in the general module...the connection has been done
see this..
the problem is when i add data into the database it throws me this error at times
Run-time error `-2147217887(80040e21)`
multiple-step operation generated errors.check each status value
and sumtimes it adds records to the database
vb Syntax (Toggle Plain Text)
Private Sub Command1_Click() SQL = "select * from cusinfo" Call connrecordset(CustomerInfo, SQL) With CustomerInfo CustomerInfo.MoveLast !Name = txtName.Text !Address = txtAddress.Text !DOB = DTDOB.Value !Age = DateDiff("yyyy", DTDOB.Value, Now()) + Int(Format(Now(), "mmdd") < Format(DTDOB.Value, "mmdd")) !Sex = cmbSex.Text !PassportNo = txtPassport.Text !Country = txtCountry.Text !City = txtCity.Text !TelephoneNo = txtHome.Text !MobileNo = txtMobile.Text !Email = txtEmail.Text .Update End With End Sub Private Sub Form_Load() Call dbconnection End Sub
////and in the general module...the connection has been done
see this..
vb Syntax (Toggle Plain Text)
Public SQL As String Public connParadise As ADODB.Connection Public CustomerInfo As ADODB.Recordset Public Sub dbconnection() 'connection to the database Set connParadise = New ADODB.Connection connParadise.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\pukoo.mdb;Persist Security Info=False" connParadise.CursorLocation = adUseClient connParadise.Open 'database connection established End Sub Public Sub connrecordset(tbname As ADODB.Recordset, sequel As String) 'connect to record set Set tbname = New ADODB.Recordset With tbname .CursorType = adOpenDynamic .LockType = adLockOptimistic .Source = sequel .ActiveConnection = connParadise .Open End With 'connection to the record set established End Sub
the problem is when i add data into the database it throws me this error at times
Run-time error `-2147217887(80040e21)`
multiple-step operation generated errors.check each status value
and sumtimes it adds records to the database
Last edited by WolfPack : Mar 22nd, 2008 at 7:07 am. Reason: Added code tags. Use them when you post code. Also corrected indenting.
•
•
•
•
the problem is when i add data into the database it throws me this error at times
Run-time error `-2147217887(80040e21)`
multiple-step operation generated errors.check each status value
do you know the meaning of this error message ?
you will face this error when you try to store value in a field and size of your data is more than the specific field's size.
for example, you are trying to store time in a age field which is probably a numeric field. now if didn't the change default value it should be 10. now if you are inserting time it can be in a format like HH:MM
SSS which becomes a numeric value also. now each data type has a limit to store values. a numeric field can hold values from -32768 to +32767. now if you try to store any value beyond this range you will face the above error. the same thing is applicable on other data types also.so check the field size and its data type and then store your value.
regards
Shouvik
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Have a problem? Don't worry just give me a call and I'll fix it for you.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Similar Threads
- Blue Screen Error (Windows NT / 2000 / XP / 2003)
- [Linker error] undefined reference to `SDL_Init' (C++)
- ialmrnt5 error (Monitors, Displays and Video Cards)
- Perl error reports: error prone (Perl)
- a disk read error has occurred (Windows NT / 2000 / XP / 2003)
- Disk Read Error while booting Windows (Windows NT / 2000 / XP / 2003)
- Delphi Pascal Error (Pascal and Delphi)
- What Should I Do Next? (Viruses, Spyware and other Nasties)
- svchost.exe error (Windows NT / 2000 / XP / 2003)
- VMWare Unrecoverable Error (*nix Software)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Collection
- Next Thread: Error Handling: Blank Error Description


Linear Mode