Click to See Complete Forum and Search --> : Connectstring to mySQL within ASP?
Berthil
Jan 9th, 2001, 05:46 AM
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
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"
Berthil
Jan 9th, 2001, 09:19 AM
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?
Berthil
Jan 9th, 2001, 09:22 AM
Yes, also without the obsolete 'Data;' part I get errors.
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
Berthil
Jan 9th, 2001, 06:02 PM
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.
Clunietp
Jan 9th, 2001, 11:32 PM
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
Berthil
Jan 10th, 2001, 06:49 AM
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
ttingen
Jan 11th, 2001, 12:39 PM
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:
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]
G.Kumaraguru
Jan 11th, 2001, 08:10 PM
Just Use Microsoft Datalink to Generate the Connection String....
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.