Connect to a mysql database using a dsn-less connection via asp

Problem:

Connect to a mysql database using a dsn-less connection via asp



Solution:

"<%
dim adoConn
dim adoRS
set adoConn = Server.CreateObject("ADODB.connection")
set adoRS = Server.CreateObject("ADODB.Recordset")
adoConn.Open "Driver={mysql}; Server=192.168.0.1; Port=3306; Option=0; Socket=; Stmt=; database=dbname; Uid=user; Pwd=password;"
adoRS.Activeconnection = adoConn
if adoConn.errors.count = 0 then
adoRS.Open "select * from dbtable"
end if
adoRS.Close
adoConn.Close
Set adoRS = nothing
Set adoConn = nothing
%>"
 
Note *Server= Enter your MySql server 
  • 0 Els usuaris han Trobat Això Útil
Ha estat útil la resposta?

Articles Relacionats

Connect to a mysql database using a dsn connection via asp

Problem: Connect to a mysql database using a dsn connection via asp Solution: * If you have...

Which port should I use, 80 or 3306 ?

Problem: Which port should I use, 80 or 3306 ? Solution: You should ALWAYS use port 3306,...

ERROR 2008: MySQL client ran out of memory

Problem: ERROR 2008: MySQL client ran out of memory Solution: Problem:   If you issue...

how we can setup a system DSN to access our MySQL database through ASP

Problem: how we can setup a system DSN to access our MySQL database through ASP Solution:...

How to Export and then Import a MySQL database using PhpMyADMIN

Problem: How to Export and then Import a MySQL database using PhpMyADMIN Solution: The...