|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP-MySQL unable to connect through DSN less Connection String
Hello friends i am new to this forum. Now i am having one problem when connecting to MySQL database with dns connection string.
I am working in Microsoft ASP. Till now i was connecting to M.S SQL to connect to database with dsn less connection string. Both my web server and database server as on the same computer so i did not have any problem connecting to the databse. But now in one project we have to use MySQL database. The script langauged to be used is ASP only. Now the database is on another server (linux server). So now i have to connect from my computer(Windows 2000) to the another computer(Linux) on LAN. For this first i installed MyODBC successfully from URL Now i am able to connect successfully from my script to the mysql databas if i provide system dsn. ( i created a system dsn when i have connected to the database residing on linux). But when i use dns less connection string then i get following error. =========================================== Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ============================================= Now the connection string that is use is as follows ------------------------------------------------------------------------------- Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "driver={MySQL}; Server=server address; Port=3306; Option=0; Socket=; Stmt=; Database=databasename; Uid=myuserid; Pwd=mypassword;" ------------------------------------------------------------------------------- in case of Server parameter i am directly providing the ip address of the linux server on which my database resides in mysql. I checked no. of sites for the solution but i couldn't find a solution to this. I strictly want to use dns less connection string only. So please let me know what should i do in this situation and what should i check for and where exactly am i going wrong? Any help will be sincerely appreciated. Thank You ![]() |
|
#2
|
|||
|
|||
|
What about this one?
Code:
oConn.Open "Provider=MySQLProv;" & _
"Data Source=mySQLDB;" & _
"User Id=myUsername;" & _
"Password=myPassword"
__________________
- Rogier Doekes |
|
#3
|
|||
|
|||
|
Thank you for you reply.
But i am still having confusion. In the code that you have given, in first line i.e. Provider=MySQLProv; Now in above line what do i have to write in provider. I was writing mySQL till now . do i have to hardcode the word "MySQLProv" ? Also the code that you have given does not inclue the "Server" and the "Port" parameter and i will have to provide that as the request that i am making to mySQL database is on another server. I tried to connect with the code that you gave. i.e i kept Provider=MySQLProv; and then change other paramerter i.e database.username and password and also included the server and port paramerter and then when i tried to connect i got following error ---------------------------------------------------------------- ADODB.Connection error '800a0e7a' Provider cannot be found. It may not be properly installed. ------------------------------------------------------------ Now i have properly installed myODBC becuase i am able to connect with DSN so i think that is not a problem. that what exactly it is. can you tell me? Thanks once again. |
|
#4
|
|||
|
|||
|
pl try with this.
Driver=mySQL};Server=db1.database.com;Port=3306;Op tion=131072;Stmt=;Database=mydb;Uid=myUsername;Pwd =myPassword |
|
#5
|
|||
|
|||
|
using ODBC try this:
DRIVER={MySQL ODBC 3.51 Driver};database=<<Database>>;server=<<server>>;uid=<<user>>;password=<<password>>;option=3; using OLEDB try this: Provider=MySQLProv;Location=<<server>>;Data Source=<<db>>;USER ID=<<user>>;PASSWORD=<<password>>;option=3;port=3306; Zeus |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > ASP-MySQL unable to connect through DSN less Connection String |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|