Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

MySQL and ASP

  • 23-02-2003 11:53PM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 7,802 ✭✭✭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

    Regards…jmcc



  • Registered Users, Registered Users 2 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, Registered Users 2 Posts: 7,802 ✭✭✭jmcc


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

    Yep. Boom * Boom = Splat. :)

    Regards...jmcc

    Regards…jmcc



  • Advertisement
  • Registered Users, Registered Users 2 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