Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

MySQL and ASP

Options
  • 23-02-2003 11:53pm
    #1
    Registered Users Posts: 2,894 ✭✭✭


    I'm trying to connect to a mySQL Database "Test" and selecting all rows from a table test using asp. Here's what I got so far. The code bombs out in the line in red:

    <%

    Set MyConn = Server.CreateObject("ADODB.Connection")
    MyConn.Open "Driver={mySQL}; Server=127.0.0.1; Option=651; Database=test;"
    Set eml = Server.CreateObject( "ADODB.Command" )
    eml.activeconnection=MyoConn


    eml.Open "SELECT * FROM test"
    WHILE NOT eml.EOF

    oname=eml("test")

    eml.MoveNext
    WEND
    eml.close
    %>

    I have myODBC driver installed. The asp error from IE given is:


    Error Type:
    ADODB.Command (0x800A0BB9)
    Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.


    Anyone tell me what I'm doing wrong ?

    Cheers,
    TC


Comments

  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    You appear to be missing username/password params to your connection string.


  • Registered Users Posts: 7,411 ✭✭✭jmcc


    Also you are checking the database "Test" but in the asp you have the database listed as 'test'. I'm not sure that MySQL on Windows is case sensitive on the selection of the database but it could cause problems trying to select a database that does not exist.

    Regards...jmcc


  • Registered Users Posts: 332 ✭✭spod


    Originally posted by jmcc
    Also you are checking the database "Test" but in the asp you have the database listed as 'test'. I'm not sure that MySQL on Windows is case sensitive on the selection of the database but it could cause problems trying to select a database that does not exist.

    Jmcc, do you know how MySql on Windows handles cartesian product joins??


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    LOL


  • Registered Users Posts: 7,411 ✭✭✭jmcc


    Originally posted by spod
    Jmcc, do you know how MySql on Windows handles cartesian product joins??

    Yep. Boom * Boom = Splat. :)

    Regards...jmcc


  • Advertisement
  • Registered Users Posts: 604 ✭✭✭Kai


    Shouldnt the line be
    eml.activeconnection=MyConn
    rather than
    eml.activeconnection=MyoConn

    as thats the name of the connection string variable. ??
    it would fit in with the error message as well.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    ROFL - Well spotted :D


Advertisement