home //

Codici sorgenti ASP

Codici sorgenti in ASP per l'accesso al database MySQL

Ecco un esempio di codice in ASP (Visual Basic)

<%

   Dim cn
   Dim rs

   Set cn = Server.CreateObject("ADODB.Connection")
   Set rs = Server.CreateObject("ADODB.Recordset")

   ' Nella stringa di connessione sotto riportata, sostituire i valori dei campi server, database, uid, pwd
   ' con i rispettivi valori che trovi nel tuo pannello di controllo: server, database, username, password
   cn.Open "driver={MySQL ODBC 3.51 Driver};" & _
   "server=127.0.0.1;database=m1d1;uid=m1d1;pwd=ehd71a9soduv62sw;"

   rs.Open "SELECT nome FROM utenti",cn
      Do Until rs.EOF
         Response.Write rs("nome") & "<br />"
         rs.MoveNext
      Loop
   rs.Close
   Set rs = Nothing

   cn.Close
   Set cn = Nothing

%>

Go back

Do you need
technical
assistance?

Our staff is always at your disposal for any queries. Contact us for free and not demanding support.

Contact Contact us
Cookies information
We use cookies to provide our services. By using this site you consent to the use of cookies.
ACCEPT DECLINE DISCLOSURES