954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

can i use mysql database with asp

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.

aarya
Junior Poster
139 posts since Sep 2005
Reputation Points: 11
Solved Threads: 0
 

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") & ""
RS.MoveNext
Wend
' closing connection
RS.Close
Conn.Close
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.

zippee
Posting Whiz in Training
294 posts since Jan 2005
Reputation Points: 10
Solved Threads: 7
 

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

aarya
Junior Poster
139 posts since Sep 2005
Reputation Points: 11
Solved Threads: 0
 

Hi,


you can learn more about asp.

just browse to www.asptutorial.info

Bye


HemantK

HemantK
Newbie Poster
4 posts since May 2006
Reputation Points: 10
Solved Threads: 0
 

how do i run mysql server 2000 in my pc

bijaykumar
Newbie Poster
1 post since May 2006
Reputation Points: 10
Solved Threads: 0
 

there isnt a mysql version 2000. and that you would have to ask in the "database" forums

william_stam
Junior Poster
131 posts since Mar 2005
Reputation Points: 10
Solved Threads: 2
 

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 :-)

oscarsierra
Newbie Poster
4 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You