Re: mySQL Connection String
From: Turkbear (noone_at_nowhere.com)
Date: 06/22/04
- Next message: Lou: "SQL Update, Insert and Delete"
- Previous message: Michael Austin: "Re: Content management system using backend database"
- In reply to: Jeff Cochran: "Re: mySQL Connection String"
- Next in thread: IPT: "Re: mySQL Connection String"
- Reply: IPT: "Re: mySQL Connection String"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Jun 2004 11:44:27 -0500
On Tue, 22 Jun 2004 14:24:21 GMT, jeff.nospam@zina.com (Jeff Cochran) wrote:
>On Tue, 22 Jun 2004 00:49:03 +0800, "IPT" <chency@streamyx.com> wrote:
>
>>I use mySQL but can connect.
>>
>>Here is my code:
>>Set myconn = Server.CreateObject("ADODB.Connection")
>>myconn.Open "ODBC; Driver=Sybase SQL Anywhere 5.0;" & _
>> "DefaultDir=c:\inetpub\dbase\;" & _
>> "Dbf=c:\inetpub\dbase\mydb.db;" & _
>> "Uid=dba;" & _
>> "Pwd=sql;" & _
>> "Dsn="""""
>>Set rs = Server.CreateObject("ADODB.Recordset")
>>
>>I get error message:
>>Microsoft OLE DB Provider for ODBC Drivers error '80004005'
>>
>>[Microsoft][ODBC Driver Manager] Data source name not found and no default
>>driver specified
>>
>>I refered to
>>http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDriverForSybaseSQLAnywhere.
>
>You say you can't connect to a MySQL database using the ODBC driver
>for a Sybase database? I guess everything is acting as expected then.
>
>Hint: When you look at a site for a connection string, picking a link
>at random rarely works. Selecting the one for the database you use,
>and modifying it according to your specific server setup, usually
>does.
>
>So, using MySQL, I'd think you'd have better luck with:
>
>http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForMySQL
>
>Data Source, User ID and Password will need to be edited for your
>specifc setup.
>
>Jeff
Actually it was the right site just wrong driver info:
Here's wht was given about MySql:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ODBC Driver for MySQL (via MyODBC)
To connect to a local database (using MyODBC Driver)
oConn.Open "Driver={mySQL};" & _
"Server=MyServerName;" & _
"Option=16834;" & _
"Database=mydb"
To connect to a remote database
oConn.Open "Driver={mySQL};" & _
"Server=db1.database.com;" & _
"Port=3306;" & _
"Option=131072;" & _
"Stmt=;" & _
"Database=mydb;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"
To connect to a local database (using MySQL ODBC 3.51 Driver)
oConn.Open "DRIVER={MySQL ODBC 3.51 Driver};" & _
"Server=myServerName;" & _
"Port=3306;" & _
"Option=16384;" & _
"Stmt=;" & _
"Database=mydatabaseName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"
Or
oConn.Open "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=myServerName;" & _
"DATABASE=myDatabaseName;" & _
"USER=myUsername;" & _
"PASSWORD=myPassword;"
Note: When you first install MySQL, it creates a "root" user account (in the sys datbase's user table) with a blank
password.
For more information, see: Programs Known to Work with MyODBC
--------------------------------------------------------------------------------
Hope it helps..
- Next message: Lou: "SQL Update, Insert and Delete"
- Previous message: Michael Austin: "Re: Content management system using backend database"
- In reply to: Jeff Cochran: "Re: mySQL Connection String"
- Next in thread: IPT: "Re: mySQL Connection String"
- Reply: IPT: "Re: mySQL Connection String"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|