Release a small software for everyone to play

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:      
       
r_soft.JPG

Download:
http://www.blogjava.net/Files/wujun/mysoft.rar


key code:
link to the database:

ExpandedBlockStart.gif ContractedBlock.gif Public   Function contoserver() Function contoserver() As Boolean '连接数据库函数
InBlock.gif
On Error GoTo Conerror
InBlock.gif    con.CursorLocation 
= adUseClient
InBlock.gif    con.ConnectionString 
= "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\db.mdb;"
 & "Persist Security Info=False"
InBlock.gif    
'con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password=wujunainiyiwn;Data Source=E:\数据\vars.mdb;Persist Security Info=True"
InBlock.gif
    con.CommandTimeout  = 20 is     con.Open     contoserver  = True the Exit Function Conerror: MsgBox " problem,! " , vbExclamation  +  vbOKOnly,  " serious problem "     contoserver  = False End Function 
InBlock.gif
InBlock.gif
 
InBlock.gif    

InBlock.gif
InBlock.gif   
 
InBlock.gif
 
ExpandedBlockEnd.gif
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
None.gif
ExpandedBlockStart.gifContractedBlock.gif
    
InBlock.gif
   
InBlock.gif    
 
InBlock.gif    
The SET  CON  = Nothing End Function 
ExpandedBlockEnd.gif
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 ."
None.gif
ExpandedBlockStart.gifContractedBlock.gif
     
InBlock.gif
  
InBlock.gif    
 
InBlock.gif    
 
InBlock.gif

InBlock.gif
 
InBlock.gif    

InBlock.gif
InBlock.gif   
 , VbExclamation  +  vbOKOnly,  " prompt " '    MsgBox "Error Number:" & Err.Number & vbCrLf _ & " Error Description: " &  Err.Description, vbCritical  +  vbOKOnly,  " Connection Error "     RunSQL  = False End Function
InBlock.gif

InBlock.gif
      
InBlock.gif
 
ExpandedBlockEnd.gif

None.gif
None.gif

Tips:

VB introduced hyperlink buttons
        1. Definitions
ExpandedBlockStart.gif ContractedBlock.gif Private   Declare   Function ShellExecute() Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA"
 (
ByVal hWnd As LongByVal lpOperation As StringByVal lpFile As StringByVal
lpParameters 
As StringByVal lpDirectory As StringByVal nShowCmd As LongAs Long
InBlock.gif

   2. Use
 
None.gif  ShellExecute  Me .hWnd,  " open " " http://www.blogjava.net/wujun " , vbNullString, vbNullString, vbNormalFocus

textBox can only enter numbers:

ExpandedBlockStart.gif ContractedBlock.gif Private Sub Text2_KeyPress () Sub  Text2_KeyPress (KeyAscii  of As Integer ) Dim  A  of As Boolean = 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    
InBlock.gif  
 
InBlock.gif
   
InBlock.gif
  
InBlock.gif
 
InBlock.gif    
 
InBlock.gif
 
ExpandedBlockEnd.gif

Reproduced in: https: //www.cnblogs.com/wujun/archive/2006/11/18/564829.html

Guess you like

Origin blog.csdn.net/weixin_34067049/article/details/93235653