?? module1.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 + -