我想从我的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