我想從我的mysql數據庫表中檢索列值(登錄名,密碼)到vbscript。我怎樣才能做到這一點?我沒有vbscript的經驗,我必須這樣做,作爲我的項目的一部分。我成功地連接到Mysql數據庫表,但我不知道如何在vbscript中檢索這些列值(都在varchar中)。我在谷歌搜索了很多,但沒有得到任何幫助。任何人都可以幫我嗎?如何檢索vbscript中的列值
0
A
回答
0
這是ASP中的一個例子,它應該讓你去你需要去的地方。注意,這給你一個連接記錄,這是去,因爲它儘可能快地釋放數據庫連接返回到池中的首選方式:
<%@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
%>
0
回答這個問題,我幫你得到你需要的地方是Connect to mysql 5.0 database using pure vbscript?
相關問題
- 1. 如何從散列中檢索值?
- 2. 如何從C#中的列表框索引檢索文本值
- 3. 如何檢索HashMap中值
- 4. 如何在VBScript中檢索文件的「產品版本」
- 5. 如何檢索Clojure中列表中的HashMap中的鍵的值?
- 6. 如何檢索列表中不同值的列表
- 7. 如何檢索Oracle序列值?
- 8. 如何檢索實際列值。
- 9. 從VBScript中檢索DLL元數據?
- 10. 如何從一個元素的nextAll()檢索列表中檢索attr值?
- 11. 如何檢索translate3d的值?
- 12. 如何在Python中使用列名檢索SQL結果列值?
- 13. 如何檢索SQL Server中同一列的多行的值
- 14. 如何檢索結構中的值swift
- 15. 如何從iPhone中的nsdictionary檢索值?
- 16. 如何檢索HTML表單中的值?
- 17. 如何檢索PhoneGap中標籤的值?
- 18. BASH,xmlstarlet如何檢索XML中的值
- 19. 如何檢索Android中的JSON值?
- 20. 如何檢索magento中的數組值
- 21. 檢索列中的所有值
- 22. 檢索表中一列的值
- 23. cakephp檢索列中的多個值
- 24. 檢索特定列的值在TDBGrid中
- 25. SQL Server:檢索列中的重複值
- 26. 如何檢索Android中的特定列?
- 27. 如何檢查MySQL中列的索引
- 28. 如何檢索Mailjet中的列表ID?
- 29. 如何在CakePHP中檢索整數列的整數值?
- 30. 如何從同一2D位置的3D陣列中檢索值?
你能告訴你的代碼成功地連接到MySQL? – AnthonyWJones 2010-01-19 14:03:43