Development2006. 4. 11. 23:52
아시는 분들도 있겠지만... ^^



ODBC로는 연결이 잘되는데 OLEDB로 연결하려고 삽질 했네요 ㅡㅡ'

이렇게 간단한걸...



1.준비물

MyOLEDB3.exe (http://www.mysql.com/downloads/download.php?

file=Downloads/Win32/MyOLEDB3.exe&pick=mirror)



2. Connect 부분

"Provider=MySqlProv;Location=xxx.xxx.xxx.xxx;Data Source=디비명;User ID=아이디;Password=패스;"

- 한글부분은 알아서 ^^ (xxx.xxx.xxx.xxx는 ip)



3. 간략 예제

<%

strcon = "Provider=MySqlProv;Location=xxx.xxx.xxx.xxx;Data Source=디비명;User ID=아이디;Password=패스;"

set DbCon = Server.CreateObject("ADODB.Connection")

DbCon.open strcon



SQL_query = "SELECT count(*) FROM 테이블명"

Set RS = DbCon.Execute(SQL_query)



Response.Write " Query : " + SQL_query + "<p>"

Response.Write " Result : "



while not RS.eof

Response.Write RS(0)

Response.Write "<br>"

RS.MoveNext

wend



RS.Close

DbCon.Close



set RS = nothing

set DbCon = nothing

%>



허접하네요...

간만에 asp를 봐서 예제두 ㅡㅡ'

좋은하루!







출처 : http://blog.naver.com/wookacula/40006412962























Posted by Blue*