⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 module1.bas

📁 计件工资统计系统 我的毕业设计 包含论文
💻 BAS
字号:
Attribute VB_Name = "Module1"
Public username As String
Sub delsql(sql)
  Dim conn As New ADODB.Connection
'Dim rs As New ADODB.Recordset

conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\database.mdb;Persist Security Info=False"
conn.Open
conn.Execute (sql)
End Sub

Function sumsql(sql) As Integer
  Dim conn As New ADODB.Connection
  Dim rs As New ADODB.Recordset
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\database.mdb;Persist Security Info=False"
conn.Open
rs.Open sql, conn, adOpenStatic, adLockOptimistic
sumsql = rs.RecordCount
End Function

Function execsql(sql) As Integer
  Dim conn As New ADODB.Connection
'Dim rs As New ADODB.Recordset

conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\database.mdb;Persist Security Info=False"
conn.Open
Set rs = conn.Execute(sql)
execsql = rs("num")
End Function

Function DanJiaKey(KeyAscii As Integer, text As String) As Integer   '控制单价格式
  DanJiaKey = KeyAscii
If Len(text) - InStr(text, ".") = 4 Then
   DanJiaKey = 0
  End If
  If KeyAscii < 47 Or KeyAscii > 58 Then
     DanJiaKey = 0
  End If
  If KeyAscii = 46 Then
     DanJiaKey = 46
  End If
    If KeyAscii = 8 Then
     DanJiaKey = 8
  End If

End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -