2010-01-19 4 views
0

내 mysql 데이터베이스 테이블에서 vbscript로 열 값 (로그인, 암호)을 가져 오려고합니다. 어떻게해야합니까? 나는 vbscript에 대한 경험이 없으며, myproject의 일부로 그렇게해야한다. MySQL 데이터베이스 테이블에 연결하는 데 성공하지만 VBScript에서 해당 열 값을 검색하는 방법 (둘 다 varchar에 있음)을 모르겠습니다. Google에서 많이 검색했지만 아무 도움도받지 못했습니다. 아무도 나를 도울 수 없습니까?vbscript에서 열 값을 검색하는 방법

+2

당신은 당신의 코드가 성공적으로 MySQL을 연결 보여줄 수 있습니까? – AnthonyWJones

답변

0

여기에 ASP의 예가 나와 있습니다. 이 당신은 가능한 한 빨리 다시 풀에 DB 연결을 해제로 갈 수있는 좋은 방법입니다 연결이 끊긴 된 레코드를 제공합니다 참고 :

<%@Language="VBScript"%> 
<!-- Include file for VBScript ADO Constants --> 
<!--#include File="adovbs.inc"--> 
<% 
    ' Connection string. 
    strCon = "Provider=sqloledb;Data Source=myServer;Initial Catalog=Northwind;User Id=myUser;Password=myPassword" 

    ' Create the required ADO objects. 
    Set conn = Server.CreateObject("ADODB.Connection") 
    Set rs = Server.CreateObject("ADODB.recordset") 

    ' Open the connection. 
    conn.Open strCon 

    ' Retrieve some records. 
    strSQL = "Select * from Shippers" 
    rs.CursorLocation = adUseClient 
    rs.Open strSQL, conn, adOpenStatic, adLockOptimistic 

    ' Disconnect the recordset. 
    Set rs.ActiveConnection = Nothing 

    ' Release the connection. 
    conn.Close 

    ' Check the status of the connection. 
    Response.Write("<BR> Connection.State = " & conn.State) 

    Set conn = Nothing 

    ' Use the diconnected recordset here. 
    Response.Write("Column1") 
    Response.Write("Column2") 

    ' Release the recordset. 
    rs.Close 
    Set rs = Nothing 
%> 

당신은 full contents of adovbs.inc here를 얻을 수 있습니다.

관련 문제