码迷,mamicode.com
首页 > 数据库 > 详细

VB 数据库操作实例:写入软件版本号(版本控制代码实现)

时间:2020-10-31 02:07:39      阅读:23      评论:0      收藏:0      [点我收藏+]

标签:func   client   provider   erro   mis   stat   OLE   where   name   

// public_IP_STRING = Trim(Text_0.Text) // public_SQLOLEDB_STRING = "Provider=SQLOLEDB.1;Password=" & public_PASSWORD & _ // ";Persist Security Info=True;User ID=" & public_USERNAME & _ // ";Initial Catalog=****;Data Source= " & _ // public_IP_STRING & ",1433" Public Function F_insert_Ver(string1 As Variant, ip_string As Variant) As String On Error Resume Next F_insert_Ver = "" If string1 <> "" And ip_string <> "" Then Dim select_string, insert_string, st, mm select_string = "select ver_sig from ut_sud_ver where ver_number = ‘" & string1 & "‘" Dim db As Connection Set db = New Connection db.CursorLocation = adUseClient db.Open public_SQLOLEDB_STRING Set rs = New Recordset rs.Open select_string, db, adOpenStatic, adLockOptimistic mm = Val(rs.RecordCount) If mm <> "" Then If mm > 0 Then update_string = "update ut_sud_ver set ver_sig=‘0‘ where ver_sig=‘1‘" db.Execute update_string update_string = "update ut_sud_ver set ver_sig=‘1‘ where ver_number=‘" & string1 & "‘" db.Execute update_string F_insert_Ver = "2" Else update_string = "update ut_sud_ver set ver_sig=‘0‘ where ver_sig=‘1‘" db.Execute update_string insert_string = "insert ut_sud_ver(ver_number,ver_sig) select ‘" & string1 & "‘,‘1‘" db.Execute insert_string st = my_sql.F_get_field(public_SQLOLEDB_STRING, "ut_sud_ver", "ver_number", "ver_number", string1) If st <> "" Then F_insert_Ver = "1" Else F_insert_Ver = "0" End If End If End If rs.Close End If End Function

VB 数据库操作实例:写入软件版本号(版本控制代码实现)

标签:func   client   provider   erro   mis   stat   OLE   where   name   

原文地址:https://blog.51cto.com/12815848/2545333

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!