i want to learn asp . can i use mysql database with asp.how to connect to mysql database.
will u tell me the basic asp tutorials for beginners.

12 Years
Discussion Span
Last Post by oscarsierra

You can. But it would be much easy to use PHP with MySQL, at least there is phpMyAdmin to help with the interface with database. Connecting mySQL in ASP is as follow (change the dbname,username and password to yours):

' Open database
Dim Conn, RS
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={MySql ODBC 3.51 Driver}; Server=localhost; database=dbname; uid=username; pwd=password; option=3;"
Set RS = Conn.Execute("SELECT * From tblcart")
' display results
While Not RS.EOF
Response.Write RS.Fields("fieldname") & "<br>"
' closing connection
Set RS = Nothing
Set Conn = Nothing

Since you just want to start learning ASP, it would be better to learn php, if you want to use mySQL. You can easily change to ASP or other server side language in the future as they are very much the same. I learnt ASP at the first place and store data in MS Access and now move to php and mySQL. It just take me couple months to master php.


thank u very much, yes i m learning php. thnaks for ur sajaction


I think there is one problem with mySQL when using ASP, when mySQL change version, your syntax written in ASP can be "out of date".... I suggest you to use ASP with MSSQL and mySQL with PHP, that makes it much easier to get help in the different forums and knowledge bases too! My experiences only, not necessary the truth :-)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.