Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

when EOF is true, error 2147352571 type mismatch

$
0
0
Hi, I have error with vb code in asp.
Below is code for add new record in database.
in syntax arec.EOF below, if eof is true (new record) then there will be error "Error: -2147352571 - Provider - Type mismatch".
But when arec.EOF is false (found existing record), none error happened.
Usually error "type mismatch" occurs when input data type is incorrect, but when I trace and remark per line to ensure, it is .eof :rolleyes:

what component is missing in my server ? because this is only happened in one of our server development.
or is there any caused ?

Thank you.

Code:

            intUOMID        = xmldom.getElementsByTagName("UOMID").item(0).text
               
                ' process and save it into server
               
                ' initialize and open recordset
                Set arec = Server.CreateObject("ADODB.RecordSet")
                        arec.ActiveConnection = acon
                        arec.CursorType = adOpenKeySet
                        arec.LockType = adLockOptimistic
                        arec.Source = "tbl_UOM"
                        arec.Filter = "int_id = '" & intUOMID & "'"
                arec.Open
               
                ' if data not found then entry new data else update data
                NewData = 0
                If arec.EOF  Then
                        ' add new data
                        NewData = 1
                        arec.AddNew
                End If


Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>