最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【按鍵精靈】連接MySQL

2023-06-23 16:55 作者:酷玩蚊仔  | 我要投稿

Set connection = CreateObject("ADODB.Connection")

//connection.Open "DSN=Mysql;UID=root;PWD=123456;PORT=3306;DATABASE=testdb;Data Source=localhost"

connection.Open "Provider=MSDASQL.1;Password=123456;Persist Security Info=True;User ID=root;Data Source=localhost;Initial Catalog=testdb"


Set recordset = CreateObject("ADODB.Recordset")


connection.BeginTrans?


SQL1 = "DELETE FROM items WHERE id = 1"

connection.Execute SQL1, resLength1

TracePrint resLength1


SQL2 = "UPDATE items SET name = '龍紋劍', price = 777 WHERE id = 2"

connection.Execute SQL2, resLength2

TracePrint resLength2


SQL3 = "INSERT INTO items(name, price) VALUES('屠龍刀', '999')"

connection.Execute SQL3, resLength3

TracePrint resLength3


TracePrint connection.Errors.Count


If connection.Errors.Count > 0 Then?

connection.RollbackTrans?

Else?

connection.CommitTrans

End If


SQL = "SELECT * FROM items"

recordset.open SQL, connection, 1


If recordset.bof And recordset.eof Then?

TracePrint "沒有記錄"

Else?

While not recordset.eof?

TracePrint recordset("id") & " " & recordset("name") & " " & recordset("price")

recordset.movenext

Wend

End If


recordset.close?

connection.close

【按鍵精靈】連接MySQL的評論 (共 條)

分享到微博請遵守國家法律
大埔县| 鹤山市| 星座| 舒城县| 奉贤区| 新绛县| 广西| 泸西县| 凤凰县| 开封县| 娄烦县| 三穗县| 泗洪县| 五家渠市| 五峰| 桃源县| 卢湾区| 蒙自县| 通州区| 巩义市| 碌曲县| 自治县| 浮山县| 茂名市| 天津市| 通许县| 西乌| 宁国市| 富宁县| 孙吴县| 林口县| 隆子县| 福安市| 罗平县| 靖州| 台湾省| 武乡县| 滁州市| 三江| 台南市| 宜昌市|