Results 1 to 11 of 11
  1. #1
    Join Date
    Dec 2005
    Posts
    11

    Question Unanswered: I need help with MySQL 5.0 on win2003. Error 800a01fb.

    I am installing MySQL on my windows 2003 server. But when trying to run a short vbscript I get error 800a01fb on Conn.Execute. The database seems to work fine from MySQL administrator and ODBC test is successful.

    Please help me with this one!


    I have installed
    * MySQL 5.0
    * MySQL ODBC v5.0
    * MySQL Administrator
    * MySQL Query Browser
    * MDAC 2.8
    * IIS 6.0

    Code:

    <%
    Set Conn = createobject("ADOBD.Connection")
    Conn.Open="Driver={MySQL Connector/ODBC v5.0};Server=Localhost;Database=MyDb;User=root;Pas sword=MyPw;Option=3;"
    MySQL="SELECT * FROM Tablename"
    set rs=Conn.Execute(MySQL)

    rs.Close
    set rs=Nothing
    Conn.Close
    set Conn=Nothing
    %>



    Errormessage (translated by me now from swedish)
    "Runtime error in Microsoft VBScript Error 800a01fb. An exception occured 'Execute'"

  2. #2
    Join Date
    Apr 2005
    Location
    Baltimore, MD
    Posts
    297
    Not sure if this still applies with 5.0 and updated ODBC drivers, but creating a recordset in asp from a MySQL 4.1.x connection can be very tricky...judging from your error, the script seems to be connecting to the database through ODBC fine, but something about the recordset is off.

    Here's a few quick fixes that were needed in my situation. First, make sure in your ODBC connection's advanced settings that the "change BIGINT columns to INT" option is checked. I think ASP can't handle BIGINTs. This probably isn't your problem, but it should be done anyways. (link)

    Also, this got me out of some problems depending upon the type of query.
    Code:
    'CREATE RECORDSETS THIS WAY WITH MYSQL!!!
    'http://forums.devarticles.com/mysql-development-50/mysql-via-asp-556.html
    'Set recordset = Server.CreateObject("ADODB.Recordset")
    
    'recordset.CursorLocation=adUseClient
    'recordset.CursorType=adOpenStatic
    'recordset.LockType=adLockBatchOptimistic
    
    'recordset.open "SELECT * FROM aTable", objConn
    Hope this helps some. If not, try to do some more research on how to create recordsets in ASP with your setup. Good luck!

  3. #3
    Join Date
    Dec 2005
    Posts
    11
    Hi, thanks for your answer. The thing is that I am running ASP with MySQL (older version) on my windows XP without problem. And also I should have mentioned that I get the same error message if I use Conn.Execute("UPDATE Tablename..."). So it seems that it is not the recordset that is the problem, it is the execution it self. So I am thinking that it might be some issue with security settings somewhere.

    Ideas?

  4. #4
    Join Date
    Dec 2005
    Location
    London, UK
    Posts
    2
    I also have the same problem, again running Win Server 2003 STD, I tried to install MySQL 4.1 and not 5.0. Still connection problems, and other stuff forced me to go back to 4.0, I wish to upgrade to 5.0 but need to understand first how to make it work, to get as little down time as possible.

    I remmeber to make the connection errors go away I had to change the connection string, but then some other errors came up.

    There's imformation about this out there, but it's sparse to say the least, so far no one could tell me; yep, had that, it was because of this, do this to solve it.

  5. #5
    Join Date
    Apr 2005
    Location
    Baltimore, MD
    Posts
    297
    Since your connection test is fine and everything with the database is normal, I'm still pretty sure there is something wrong with your recordset or connection object. The error is coming from the Execute line which means the problem source is either the connection object, the recordset object, or the sql.

    Rather than using the long string to create the connection, try setting up a DSN and connecting using that. I feel like the MyODBC driver will give you a better way to figure out which options are being selected. Also try messing around with the recordset options.

    Have you found anything googling? How to create recordsets and connections in asp using MySQL? I'm not terribly familiar with ASP, but is there a way to get more information out of your error message?

  6. #6
    Join Date
    Dec 2005
    Posts
    11
    Quote Originally Posted by jfulton
    Since your connection test is fine and everything with the database is normal, I'm still pretty sure there is something wrong with your recordset or connection object. The error is coming from the Execute line which means the problem source is either the connection object, the recordset object, or the sql.

    Rather than using the long string to create the connection, try setting up a DSN and connecting using that. I feel like the MyODBC driver will give you a better way to figure out which options are being selected. Also try messing around with the recordset options.

    Have you found anything googling? How to create recordsets and connections in asp using MySQL? I'm not terribly familiar with ASP, but is there a way to get more information out of your error message?
    Yes it seems to be something with the connection. But the line where the connection takes place work fine, the error comes on the Execute-line. And since I get the same error even without recordsets it is probably the connection that is wrong or maybe some security settings preventing access to the database for the internet user.

    How do you mean that I could connect another way. Now I have an ODBC-connection using DSN. Or can that be done any other way? I am by no means expert in this field. Well you can see my code above. In the connection line I connect through my ODBC to my database. And since the ODBC-connection works fine when I test it I cant understand what the fault is.

  7. #7
    Join Date
    Apr 2005
    Location
    Baltimore, MD
    Posts
    297
    The only security settings that would have any affect is if the ASP user doesn't have privileges to run mysql (and I'm assuming that is unlikely) or if you are connecting to the database as a database user with inadequate permissions. But both of those should create different errors.

    What I was talking about before is that (I believe) when you connect to a database in ASP you can use a few different types of connection strings. You can have the long connection string which you are using now, or you can just use the DSN name. It should be one of these, I forget which:

    Code:
    'Conn.Open "MySQLDatabase"
    ' or
    'Conn.Open "DSN=MySQLDatabase"
    Now your ASP connection object will be using the same server, username, password, options, etc. as the ODBC connection you have set up. Another advantage to this is that you can set the options in the ODBC Manager (or whatever it is called) in Windows . I don't have a Windows machine to check right now, but there should be an advanced tab/window for each DSN. Go into the System DSNs and check out the advanced properties for your MySQL ODBC connection. This is where you can tweak things and know what you're changing rather than looking up and changing the "option" value in your connection string.

    This could all be a bunch of junk since I haven't done this in a while and am just going off of my memory right now, but I'm pretty sure that this is the best way to figure it out.

  8. #8
    Join Date
    Dec 2005
    Posts
    11
    Sounds lika an excellent way to connect. But when trying it I cant establish connection. "Datasource not found and no standard driver is stated"

    I have trippled checked my spelling, and I tryied both ways you mentioned.

  9. #9
    Join Date
    Apr 2005
    Location
    Baltimore, MD
    Posts
    297
    hmmm...whenever I tried googling I got the same code as I posted earlier.
    Code:
    conn.open "DSN=dsnsource"
    Maybe the DSN needs to be a System DSN? I'm not sure. I really wish I could be of more help. Using the DSN connection isn't going to solve your problem, but it will hopefully make solving it a lot easier.

  10. #10
    Join Date
    Dec 2005
    Posts
    11
    With a system DSN it actually works to connect!

    But unfortunately, as you guessed, that did not solve my problem. Now I am back with the same error on Execute.

  11. #11
    Join Date
    Dec 2005
    Posts
    14
    I am having similar problems after upgrading to MYSQL 5.0 and have got round it by using an older MYODBC driver and then updating my mysql user table changing the password to OLD_PASSWORD, still looking for a better solution however.

    Code:

    mysql --user=user --pass=password mysql

    UPDATE mysql.user SET Password = OLD_PASSWORD('password') WHERE Host = 'host' AND User = 'username';

    FLUSH PRIVILEGES;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •