I have got error Microsoft VBScript runtime (0x800A01FB)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jimmylee
    New Member
    • Feb 2008
    • 17

    #1

    I have got error Microsoft VBScript runtime (0x800A01FB)

    Hi All,Please help me check my code. I have got running time error (0x800A01FB).An exception occurred: 'objConn.Execut e'

    some records execute but some records don't. I have no idea how to solve them.
    Thanks a lot.
    Here is my code
    Code:
    dim i_svAppDbConnstr, i_svDBConn
    i_svAppDbConnstr = "Provider=OraOLEDB.Oracle;Data Source=database_name;User Id=user_id;Password=password;"
     
    Set i_svDBConn = OpenConn(i_svAppDbConnstr)
     
    Function OpenConn(strConnStr)
    	Dim objDbConn
    	Set objDbConn = Server.CreateObject("ADODB.Connection")
    	objDbConn.CursorLocation = 3
    	objDbConn.Open strConnStr
    	Set OpenConn = objDbConn
    End Function
    Function GetData(strQuery, objConn)
    'On Error Resume Next
    	Dim objRS
    	Set objRS = objConn.Execute(strQuery) ' this line is error.
    	Set GetData = objRS
    End Function 
    Function GetAppData(strQuery)
    	Set GetAppData = GetData(strQuery, i_svDbConn)
    End Function
     
    'I call the GetAppData function.
    strsql = "Select * from ARTICLE where ART_NR = '" & trim(replace(reqName,"'","''")) & "'"
    Set rstTrans = GetAppData(strSQL)
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi jimmylee,

    There isn't a problem with your code (it works fine on my machine) but there it may be that you need to install a newer version of the MDAC (Microsoft Data Access Components). Basically this contains things like the ODBC drivers that hook you up to your databases and there is a bug in earlier releases that sometimes causes the problem you describe.

    You can download the latest version of it here. Give it a try and see if it solves your problem.

    Let me know how you get on.

    Dr B

    Comment

    Working...