SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Addict AHMED's Avatar
    Join Date
    Oct 2002
    Location
    Egypt
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql connection error

    hi all
    i have mysql database i made it with phpmyadmin which comes with php dev program

    so how can i manage mysql database through iis

    also i tried to connect it with this :

    ConnectionString="Driver={mySQL};" & _
    "Server=local;" & _
    "Option=16834;" & _
    "Database=ahmed"


    and got this error

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    /school/cn.inc, line 17


    also how can i connect it from my asp pages ?

  2. #2
    Santos L Halper Zenith's Avatar
    Join Date
    May 2002
    Location
    Finland
    Posts
    641
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Download MyODBC and make an ODBC connection

    http://www.mysql.com/downloads/api-myodbc-3.51.html

  3. #3
    SitePoint Addict AHMED's Avatar
    Join Date
    Oct 2002
    Location
    Egypt
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Zenith
    Download MyODBC and make an ODBC connection

    http://www.mysql.com/downloads/api-myodbc-3.51.html
    so how can i make the odbc connection

  4. #4
    SitePoint Addict AHMED's Avatar
    Join Date
    Oct 2002
    Location
    Egypt
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i added the MySQL ODBC in the Data Sources (ODBC) in my windows control panel and when testing the connection it success
    but when i do it through the asp pages the same error still on

    so must i change my connection string or what ?

  5. #5
    SitePoint Addict AHMED's Avatar
    Join Date
    Oct 2002
    Location
    Egypt
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is it too hard ?

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 1999
    Location
    Jacksonville, FL
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AHMED
    hi all

    ConnectionString="Driver={mySQL};" & _
    "Server=local;" & _
    "Option=16834;" & _
    "Database=ahmed"
    Well, getting ODBC set up was necessary, but your connection string is wrong as well. Try:

    "Server=localhost;" & _

    shawn

  7. #7
    Santos L Halper Zenith's Avatar
    Join Date
    May 2002
    Location
    Finland
    Posts
    641
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After you've made the DSN alias for the MySQL DB:

    Set myconn = Server.CreateObject("ADODB.Connection" )
    myconn.Open "DSN_name", "user", "pass"

    strSQL = "SELECT foo FROM bar"
    set RS = myconn.Execute(strSQL)

    IF NOT RS.EOF THEN
    my_results = RS.GetRows()
    END IF

    Cannot get any easier.

    -Z-

  8. #8
    SitePoint Addict AHMED's Avatar
    Join Date
    Oct 2002
    Location
    Egypt
    Posts
    399
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Zenith
    After you've made the DSN alias for the MySQL DB:

    Set myconn = Server.CreateObject("ADODB.Connection" )
    myconn.Open "DSN_name", "user", "pass"

    -Z-
    thx it's working but how can i use it on a web server ?

  9. #9
    SitePoint Enthusiast
    Join Date
    Jul 1999
    Location
    Jacksonville, FL
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AHMED,

    Who's solution did you employ -- I'm assuming you created a DSN as described by Zenith. It's the same process on a Web server except that (if you don't have your own server) you'll need to have an admin set up the DSN for you and I'd recommend going this route over a dsn-less connection as you probably won't simply be able to call your db by "localhost" -- ALTHOUGH -- I could be wrong about that -- I don't know how hosting co's set up MySQL databases on shared servers.

    If this helps - GREAT - if not, I'm sure Zenith will be right behind me to clean up the mess!

  10. #10
    Santos L Halper Zenith's Avatar
    Join Date
    May 2002
    Location
    Finland
    Posts
    641
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uh oh, I'm lost (again) with Ahmed. He said earlier:
    I added the MySQL ODBC in the Data Sources (ODBC) in my windows control panel ...
    If that ODBC-connection worked what's the problem? You did what you said on your own computer but cannot do it on the web server?

    Hard to say what he's up to.

  11. #11
    ********* User Jmi's Avatar
    Join Date
    Dec 2002
    Location
    Australia
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think the webserver is not a box which he can have access to maybe
    Signature not found.

  12. #12
    SitePoint Enthusiast
    Join Date
    Jul 1999
    Location
    Jacksonville, FL
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post

    Quote Originally Posted by Jmi
    i think the webserver is not a box which he can have access to maybe
    Most likely -- but he's SO close!

    Ahmed -- check out your hosting site for information on how to go about getting set up properly. The good news is that you're close and as long as your host supports your needs, you should be able to get up and running from where you are at now.


Bookmarks

Posting Permissions

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