While VB is dead. . But to write about small desktop software is still very good. But I would be returned to the teacher. . Almost forgotten. . ~~~~~~~~~~
long ago written in VB. . . Also a few lines of code. . . . No technical skills
download without installation. . Run directly. .
Screenshot:
Download:
http://www.blogjava.net/Files/wujun/mysoft.rar
key code:
link to the database:
Tips:
VB introduced hyperlink buttons
1. Definitions
2. Use
textBox can only enter numbers:
long ago written in VB. . . Also a few lines of code. . . . No technical skills
download without installation. . Run directly. .
Screenshot:
Download:
http://www.blogjava.net/Files/wujun/mysoft.rar
key code:
link to the database:
Public
Function contoserver()
Function contoserver() As Boolean '连接数据库函数
On Error GoTo Conerror
con.CursorLocation = adUseClient
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\db.mdb;"
& "Persist Security Info=False"
'con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password=wujunainiyiwn;Data Source=E:\数据\vars.mdb;Persist Security Info=True"
con.CommandTimeout = 20 is con.Open contoserver = True the Exit Function Conerror: MsgBox " problem,! " , vbExclamation + vbOKOnly, " serious problem " contoserver = False End Function
Public Function closecon () Function closecon () of As Boolean ' closing the connection a function of the On Error Resume the Next the If ( Not CON Is is Nothing ) the Then con.Close
The SET CON = Nothing End Function
Public Function RunSQL () Function RunSQL ( ByVal strSQL of As String ) of As Boolean ' execute a query function of the On Error GoTo runerror the SET RST = Nothing the SET RST = New ADODB.Recordset rst.Open strSQL, CON, adOpenDynamic , adLockOptimistic, - 1 RunSQL = True Exit Function runerror: MsgBox " run phrase wrong ."
, VbExclamation + vbOKOnly, " prompt " ' MsgBox "Error Number:" & Err.Number & vbCrLf _ & " Error Description: " & Err.Description, vbCritical + vbOKOnly, " Connection Error " RunSQL = False End Function
On Error GoTo Conerror
con.CursorLocation = adUseClient
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\db.mdb;"
& "Persist Security Info=False"
'con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password=wujunainiyiwn;Data Source=E:\数据\vars.mdb;Persist Security Info=True"
con.CommandTimeout = 20 is con.Open contoserver = True the Exit Function Conerror: MsgBox " problem,! " , vbExclamation + vbOKOnly, " serious problem " contoserver = False End Function
Public Function closecon () Function closecon () of As Boolean ' closing the connection a function of the On Error Resume the Next the If ( Not CON Is is Nothing ) the Then con.Close
The SET CON = Nothing End Function
Public Function RunSQL () Function RunSQL ( ByVal strSQL of As String ) of As Boolean ' execute a query function of the On Error GoTo runerror the SET RST = Nothing the SET RST = New ADODB.Recordset rst.Open strSQL, CON, adOpenDynamic , adLockOptimistic, - 1 RunSQL = True Exit Function runerror: MsgBox " run phrase wrong ."
, VbExclamation + vbOKOnly, " prompt " ' MsgBox "Error Number:" & Err.Number & vbCrLf _ & " Error Description: " & Err.Description, vbCritical + vbOKOnly, " Connection Error " RunSQL = False End Function
Tips:
VB introduced hyperlink buttons
1. Definitions
Private
Declare
Function ShellExecute()
Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA"
(ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal
lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
(ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal
lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
2. Use
ShellExecute
Me
.hWnd,
"
open
"
,
"
http://www.blogjava.net/wujun
"
, vbNullString, vbNullString, vbNormalFocus
textBox can only enter numbers:
Private
Sub Text2_KeyPress () Sub Text2_KeyPress (KeyAscii of As Integer ) Dim A of As Boolean A = Chr (KeyAscii) Like " [0-9] " Or KeyAscii = . 8 the If A = False the Then KeyAscii = 0 MsgBox " here, but to the input digital Oh! " , vbInformation + vbOKOnly, " prompt " End the If End Sub
Reproduced in: https: //www.cnblogs.com/wujun/archive/2006/11/18/564829.html