ASP .mdb ADO OLE automation error - but works in access!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SÁRINGER Zoltán

    ASP .mdb ADO OLE automation error - but works in access!

    Hello!

    I have an ASP page using Jet 4.0 oldeb provider for mdb. (ADO 2.8). I use
    the _same_ code in ASP from my well working VB application.
    The problem is:

    when I do the same "SELECT * FROM table WHERE field1 LIKE '%asdf%' " query,
    it works in Access (SQL query) or in my VB .exe code, but generates OLE
    automation error in ASP. The same code!!!
    If I use "=" instead of LIKE, it works. (field1 is string type). But I need
    LIKE...

    Why have this? Any idea?


  • joker

    #2
    Re: ASP .mdb ADO OLE automation error - but works in access!

    What is the exact error message you are receiving?

    SÁRINGER Zoltán wrote:
    [color=blue]
    > Hello!
    >
    > I have an ASP page using Jet 4.0 oldeb provider for mdb. (ADO 2.8). I use
    > the _same_ code in ASP from my well working VB application.
    > The problem is:
    >
    > when I do the same "SELECT * FROM table WHERE field1 LIKE '%asdf%' " query,
    > it works in Access (SQL query) or in my VB .exe code, but generates OLE
    > automation error in ASP. The same code!!!
    > If I use "=" instead of LIKE, it works. (field1 is string type). But I need
    > LIKE...
    >
    > Why have this? Any idea?
    >
    >[/color]

    Comment

    • Bob Barrows [MVP]

      #3
      Re: ASP .mdb ADO OLE automation error - but works in access!

      SÁRINGER Zoltán wrote:[color=blue]
      > Hello!
      >
      > I have an ASP page using Jet 4.0 oldeb provider for mdb. (ADO 2.8).
      > I use the _same_ code in ASP from my well working VB application.
      > The problem is:
      >
      > when I do the same "SELECT * FROM table WHERE field1 LIKE '%asdf%' "
      > query, it works in Access (SQL query) or in my VB .exe code, but
      > generates OLE automation error in ASP. The same code!!!
      > If I use "=" instead of LIKE, it works. (field1 is string type). But
      > I need LIKE...
      >
      > Why have this? Any idea?[/color]

      Show us the error message.

      Are you using dynamic sql? If so, Use response.write to see the actual
      query being sent to the database.

      Bob Barrows
      --
      Microsoft MVP - ASP/ASP.NET
      Please reply to the newsgroup. This email account is my spam trap so I
      don't check it very often. If you must reply off-line, then remove the
      "NO SPAM"


      Comment

      • SÁRINGER Zoltán

        #4
        Re: ASP .mdb ADO OLE automation error - but works in access!

        First, thank you for your replies...!

        I've put onto web the screenshots:

        http://www.optinfo.hu/helpme/ie_err.jpg (hungarian message in IE about the
        500.x http error, and error number)
        http://www.optinfo.hu/helpme/jet_like_error.jpg (debug screen in Interdev,
        on the line: rs.open "SELECT..." )

        the connectionstrin g is:

        str_conn = "Provider=Micro soft.Jet.OLEDB. 4.0;Jet OLEDB:Database
        Password=;Data Source=g:\vb60\ autoflex-feladatutemezo\ db\feladat.mdb; "

        Everything else are the defaults. Really, if I change "LIKE" to "equal" it
        works. This is a very simple code!!!! What do you recommend? Why doesnt work
        this simple query in ASP, what is the difference using the same ADODB
        component in VB6 or in ASP? (How can I ensure that ASP uses ADO 2.8.. (in
        VB6 I can select in the referencies, but in ASP...?)

        waiting for your suggestions...
        Zoltan


        Comment

        • Bob Barrows [MVP]

          #5
          Re: ASP .mdb ADO OLE automation error - but works in access!

          SÁRINGER Zoltán wrote:[color=blue]
          > First, thank you for your replies...!
          >
          > I've put onto web the screenshots:
          >
          > http://www.optinfo.hu/helpme/ie_err.jpg (hungarian message in IE
          > about the 500.x http error, and error number)
          > http://www.optinfo.hu/helpme/jet_like_error.jpg (debug screen in
          > Interdev, on the line: rs.open "SELECT..." )
          >
          > the connectionstrin g is:
          >
          > str_conn = "Provider=Micro soft.Jet.OLEDB. 4.0;Jet OLEDB:Database
          > Password=;Data Source=g:\vb60\ autoflex-feladatutemezo\ db\feladat.mdb; "[/color]

          If g: is a mapped network drive, your IUSR account will probably not be able
          to find it. You should use the UNC nomenclature in that case. Also, you need
          to force this website to run under a domain account instead of the default
          local IUSR account. Based on your below statement that changing "LIKE" to
          "=", I doubt that this is your problem, In fact, I've probably wasted my
          time typing this, since if this was a problem, you would be talking to us
          about connection failure instead of OLE Automation Error ....
          [color=blue]
          >
          > Everything else are the defaults. Really, if I change "LIKE" to
          > "equal" it works. This is a very simple code!!!! What do you
          > recommend? Why doesnt work this simple query in ASP, what is the
          > difference using the same ADODB component in VB6 or in ASP? (How can
          > I ensure that ASP uses ADO 2.8.. (in VB6 I can select in the
          > referencies, but in ASP...?)
          >
          > waiting for your suggestions...
          > Zoltan[/color]

          Everything I've found about this error indicates a problem with your MDAC
          installation. Go to the microsoft site and download the Component Checker
          which will verify the problem (mismatched dll's). The fix will depend on
          your operationg system.

          Bob barrows

          --
          Microsoft MVP - ASP/ASP.NET
          Please reply to the newsgroup. This email account is my spam trap so I
          don't check it very often. If you must reply off-line, then remove the
          "NO SPAM"


          Comment

          • Bob Barrows [MVP]

            #6
            Re: ASP .mdb ADO OLE automation error - but works in access!

            SÁRINGER Zoltán wrote:[color=blue]
            > Hello,
            >
            > Bob, attached the result of component checker.[/color]

            I'm not the person who needs to see that. If it contains errors, and you do
            not know how to correct them, then you need to call MS Product Support.
            [color=blue]
            >
            > I have simple JET database with simple query. It works from Access[/color]

            <snip>[color=blue]
            >
            > Please help me![/color]

            I'm stumped. There is nothing to be found in Google about your error beyond
            there being a problem with MDAC.I've read that MDAC problem in W2K can be
            corrected by running Windows Setup and choosing the Repair option.

            Beyond that I think you need to call MS Product Support. If you get this
            resolved we would appreciate you posting the solution so we can help the
            next person with this problem.

            Bob Barrows
            --
            Microsoft MVP -- ASP/ASP.NET
            Please reply to the newsgroup. The email account listed in my From
            header is my spam trap, so I don't check it very often. You will get a
            quicker response by posting to the newsgroup.


            Comment

            • Brendan Reynolds

              #7
              Re: ASP .mdb ADO OLE automation error - but works in access!

              What is the data type of the field "megjegyzes "?

              --
              Brendan Reynolds (Access MVP)
              Blogger ist ein Veröffentlichungs-Tool von Google, mit dem du ganz einfach deine Gedanken der Welt mitteilen kannst. Mit Blogger kannst du problemlos Texte, Fotos und Videos in deinem persönlichen Blog oder deinem Team-Blog veröffentlichen.


              The spammers and script-kiddies have succeeded in making it impossible for
              me to use a real e-mail address in public newsgroups. E-mail replies to
              this post will be deleted without being read. Any e-mail claiming to be
              from brenreyn at indigo dot ie that is not digitally signed by me with a
              GlobalSign digital certificate is a forgery and should be deleted without
              being read. Follow-up questions should in general be posted to the
              newsgroup, but if you have a good reason to send me e-mail, you'll find
              a useable e-mail address at the URL above.


              "SÁRINGER Zoltán" <info@optinfo.h u> wrote in message
              news:%23uh74JTi EHA.3632@TK2MSF TNGP09.phx.gbl. ..[color=blue]
              > Hello,
              >
              > Bob, attached the result of component checker.
              >
              > I have simple JET database with simple query. It works from Access and VB
              > and WSH, but generates OLE automation error in ASP. The exact problem is[/color]
              the[color=blue]
              > LIKE operator. If I change this to '=', works!
              > The PC is pure:
              > - W2000 SP4, (hun)
              > - JET SP8, (hun)
              > - MDAC 2.8, (hun)
              > - VB6-Interdev SP6
              > only on clean w2000 works, but i don't know what software installation
              > causes the problem. Maybe language or national setting problem somewhere[/color]
              in[color=blue]
              > IIS?
              >
              > <!-- #include file="adovbs.in c" -->
              > <%
              > Dim str_conn
              > Dim cn
              > Dim rs
              >
              > set cn=server.creat eobject("ADODB. Connection")
              > str_conn = "Provider=Micro soft.Jet.OLEDB. 4.0;Jet OLEDB:Database
              > Password=;Data Source=g:\vb60\ autoflex-feladatutemezo\ db\feladat.mdb; "
              > cn.Open str_conn
              >
              > set rs=server.Creat eObject("ADODB. Recordset")
              > rs.open "SELECT * FROM feladat WHERE megjegyzes LIKE '%12345%' ",cn
              >
              >
              > set rs=nothing
              > set cn=nothing
              > %>
              >
              > See the screenshots at:
              >
              > http://www.optinfo.hu/helpme/
              >
              > The problem is exactly the 'LIKE' keyword, not permission or anything
              > else...
              >
              > Please help me!
              >
              >
              >[/color]


              Comment

              • SÁRINGER Zoltán

                #8
                Re: ASP .mdb ADO OLE automation error - but works in access!

                field "megjegyzes " is:
                string (250), unicode, "non required", non indexed, no allow NULLs

                but in w2k works, just some software installation messes it up. Now I'm
                going to install opsys from the begining, and watch when will not work...



                Comment

                Working...