| | |
Run-Time Error '-2147217842(80040e4e)
Thread Solved |
•
•
Join Date: Nov 2008
Posts: 5
Reputation:
Solved Threads: 0
hello all
i am facing a problem when i try to add new records in to data base. first of all my tech details are given below
Front end - vb 6
Back end - Microsoft SQL Server 2000
i am connecting to sql through ADODB connection ( through code ). my purpose is when i click on the "ok" button then the records entered in my form will add to the database. but when i click on the ok button then a errors comes saying
" Run-time error '-2147217840(80040e4e)'
operation was canceled "
and the error is highlighted in adorset.Move 0
my code is like this
one of the funniest thing is that if we press debug and run in regular base the record will be saved in to the table
please help me
i am facing a problem when i try to add new records in to data base. first of all my tech details are given below
Front end - vb 6
Back end - Microsoft SQL Server 2000
i am connecting to sql through ADODB connection ( through code ). my purpose is when i click on the "ok" button then the records entered in my form will add to the database. but when i click on the ok button then a errors comes saying
" Run-time error '-2147217840(80040e4e)'
operation was canceled "
and the error is highlighted in adorset.Move 0
my code is like this
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
If (MsgBox("Are You Sure? You Want to Save The Record?", vbYesNo) = vbYes) Then adorset.Move 0 adorset.Update MsgBox "Record Saved" Call rsEmpC Call constateC Unload Me End If End Sub
one of the funniest thing is that if we press debug and run in regular base the record will be saved in to the table
please help me
Do you need
However, you do have a connection object. Check from the connection object which is the native error and description
where oConn is your connection object.
adorset.Move 0 ?However, you do have a connection object. Check from the connection object which is the native error and description
oConn.Errors(0).NativeError oConn.Errors(0).Description
Teme64 @ Windows Developer Blog
•
•
Join Date: Nov 2008
Posts: 5
Reputation:
Solved Threads: 0
thanks for your replay
i need "move 0" because of another error please check this link and help me to solve it
http://support.microsoft.com/kb/q195638/
i need "move 0" because of another error please check this link and help me to solve it
http://support.microsoft.com/kb/q195638/
I see. I wasn't aware of that.
However, the article suggested a solution that should solve the problem. This is, if I did understood it right. Update MDAC (latest version is 2.8) and use a client-side cursor. The article was updated 2005 for MDAC 2.5, so maybe just updating MDAC to 2.8 could solve the problem without the need to use client-side cursor. Is this possible to do or do you already have the latest MDAC?
However, the article suggested a solution that should solve the problem. This is, if I did understood it right. Update MDAC (latest version is 2.8) and use a client-side cursor. The article was updated 2005 for MDAC 2.5, so maybe just updating MDAC to 2.8 could solve the problem without the need to use client-side cursor. Is this possible to do or do you already have the latest MDAC?
Teme64 @ Windows Developer Blog
Then I'll refer to my first reply. At the point of error, what values does
have? oConn is your connection object. Also what type of CursorType property do you use?
oConn.Errors(0).NativeError oConn.Errors(0).Description
Teme64 @ Windows Developer Blog
•
•
Join Date: Nov 2008
Posts: 5
Reputation:
Solved Threads: 0
i use
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
adorset.CursorType = adOpenDynamic adorset.LockType = adLockOptimistic
Ok. Here's a snippet from the code I'm using now:
adding
I'm still curious about
VB Syntax (Toggle Plain Text)
Set oConn = New ADODB.Connection ConStr = "PROVIDER=SQLOLEDB;Data Source=XXX; INITIAL CATALOG=XXXlab; User ID=XXX; Password=XXX;" oConn.Open ConStr ... Dim oRs As New ADODB.Recordset oRs.CursorLocation = adUseClient strGridSQL = "SELECT * FROM [" & XXX & "]" oRs.Open strGridSQL, oConn, adOpenDynamic, adLockOptimistic oRs.Move 0 ' No error here or after
oRs.Move 0 has no effect, in the sense that no error occurs. My dev DB is SQL Server 2005 but I doubt that makes a difference (the code has been tested and targeted to 2000).I'm still curious about
oConn.Errors(0).NativeError and oConn.Errors(0).Description values? Teme64 @ Windows Developer Blog
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Printing information
- Next Thread: Important: Having problems with assignment due 20/11/08(tomr) need help please
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





