Results 1 to 10 of 10

Thread: Connectstring to mySQL within ASP?

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Netherlands
    Posts
    54

    Question

    It should be easy since I know how to do this with IIS and MSAccess and even on a local PC with IIS5 and mySQL, but I can't figure it out.

    Someone knows a working ADO Connectstring with DSN, PWD and UID to connect to a mySQL database on an Apache server with Chilisoft ASP? Readonly, forwardonly is ok.

    If I know this, 20.000 icons (as ICO and GIF) are online in a breeze with a search option, FOR FREE.

    Thanks
    A mind is like a parachute, it has to open to let it work
    www.2beesoft.com for Icon Manager with over 20.000 free icons
    VB6 Ent. SP4, ASP, W2000/W98

  2. #2
    Guest
    set Conn = Server.CreateObject("ADODB.Connection")

    Conn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;Data Source=BerthilsSQLServer;Database=Northwind;User ID=DBA;PWD=pwd;Application Name=BerthilsAPP"

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Netherlands
    Posts
    54

    Unhappy Doen't work

    Thanks, but

    I Still get this error

    ADODB.Connection.1 error '80004005'
    Connection not open
    inc_getit.asp, line 7

    I changed your string though because I use a DSN. Now it looks like:

    set conn=server.createobject("adodb.connection")
    conn.open "Provider=SQLOLEDB.1;Persist Security Info=False;Data;DSN=dsnname;UID=myname;PWD=password"

    Is the provider right for mySQL?
    A mind is like a parachute, it has to open to let it work
    www.2beesoft.com for Icon Manager with over 20.000 free icons
    VB6 Ent. SP4, ASP, W2000/W98

  4. #4

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Netherlands
    Posts
    54

    Unhappy sorry

    Yes, also without the obsolete 'Data;' part I get errors.

  5. #5
    Guest
    It doesn't appear that you name a dataprovider or a database name in your sql string:

    Data Source=BerthilsSQLServer <----this is you actual SQLserver

    Database=Northwind <----the database you want to connect to

  6. #6

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Netherlands
    Posts
    54

    Unhappy still not

    Stiil doesn't work. From PhPAdmin I can see that the mySQL server name = Localhost. I know my database name, user and password from the provider, but what is the 'Application Name'?

    Maybe I should have choosen an other provider, the current one can't or won't tell me a correct connection string.

  7. #7
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    I searched on the web, and this is what I came up with:

    Driver={MySQL};Server=192.168.21.52;DATABASE=INETDB;UID=readonly;PWD=MyPassword;

    This appears to use a DSN with the name of MySQL

    Bubba: mySQL is a different database server (usually Linux/UNIX based, but runs on Windows too), as opposed to SQL Server on Windows

  8. #8

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Netherlands
    Posts
    54

    Unhappy Doesn't work either

    Looked good but didn't work. Thanks anyway.

    The server is a Linux server at my provider, I'vegot a DSN there.

    At home I use Win2000 with IIS5.0 and mySQL server with a DSN, all works fine there, but can't get the connection with my provider
    A mind is like a parachute, it has to open to let it work
    www.2beesoft.com for Icon Manager with over 20.000 free icons
    VB6 Ent. SP4, ASP, W2000/W98

  9. #9
    Lively Member
    Join Date
    Jul 2000
    Posts
    104
    The DSN should have all of the connection information in it already - like Driver, User ID, Password, Database, etc.

    So you should be able to use this code:
    Code:
    Set cn = Server.CreateObject(ADODB.Connection
    cn.Open  "FILEDSN=MyDSN.dsn"
    Now - the database is running on a Linux server? If so, I don't think ADO is going to work because the MDAC doesn't run on non-Microsoft OS's, if I'm not mistaken. I only do Windows.

    [Edited by ttingen on 01-11-2001 at 02:00 PM]
    Um americano que fala portugues.

  10. #10
    Addicted Member
    Join Date
    Feb 2000
    Posts
    224

    Just Use Microsoft Datalink to Generate the Connection String....
    If you can't pronounce my name, call me GURU

Posting Permissions

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



Click Here to Expand Forum to Full Width