-
Nov 24th, 2006, 06:44 AM
#1
Thread Starter
Lively Member
run-time error (80040e21) Multiple-step OLE DB
Hi all
I have the following error
run-time error (80040e21) Multiple-step OLE DB
when I execute the code
Public Function InserePresenca(ByVal Uid As Long, ByVal autorizacao As String, _
myConn As ADODB.Connection) As Integer
Dim myRs As ADODB.Recordset
Dim tmpDate As Date
Set myRs = New Recordset
With myRs
.CursorType = adOpenForwardOnly
.LockType = adLockOptimistic
.Open "Presenças", myConn, , , adCmdTable
End With
myRs.AddNew
Please Help!!!
-
Nov 24th, 2006, 07:46 AM
#2
Re: run-time error (80040e21) Multiple-step OLE DB
Please Post in which line you are getting the error, For getting the connection in the vb through a simple code read the tutorial at my signature click on the Vb New user general Problem.
-
Nov 24th, 2006, 08:01 AM
#3
Re: run-time error (80040e21) Multiple-step OLE DB
I'm not sure about this, but the problem might be to do with the table name. Try this instead of your With block:
VB Code:
myRs.Open "SELECT * FROM [Presenças]", myConn, adOpenForwardOnly, adLockOptimistic, adCmdText
..if that doesn't work, try changing adLockOptimistic to adLockReadOnly.
-
Nov 24th, 2006, 09:36 AM
#4
Thread Starter
Lively Member
Re: run-time error (80040e21) Multiple-step OLE DB
Hi
Thank you
I solved the problem..
In one line of the code
myRs("Tipo") = autorizacao
The error was caused because Myrs("Tipo") was type nvchar(1) and autorizacao was = "MEG"
Thank you
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
|