Although VB
Dead .. However, it is quite good to write small desktop software. But I gave it back to my teacher .. I forgot about it ..~~~~~~~~~~
I wrote it a long time ago using VB... Just a few lines of code .... No technical skills
Download not required
.. Run it directly ..
:
:
Http://www.blogjava.net/Files/wujun/mysoft.rar
Key code:
Link database:
Public Function contoserver () function contoserver () as Boolean 'connect to the Database 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: \ data \ vars. mdb; persist Security info = true"
Con. commandtimeout = 20
Con. Open
Contoserver = true
Exit Function
Conerror:
Msgbox "problem ,! ", Vbexclamation + vbokonly," serious problem"
Contoserver = false
End Function
Public Function closecon () function closecon () as Boolean 'close the Connected Function
On Error resume next
If (not con is nothing) Then con. Close
Set con = nothing
End Function
Public Function runsql () function runsql (byval strsql as string) as Boolean 'function used to execute the query statement
On Error goto runerror
Set rst = nothing
Set rst = new ADODB. recordset
RST. Open strsql, Con, adopendynamic, adlockoptimistic,-1
Runsql = true
Exit Function
Runerror:
Msgbox "An error occurred while running this sentence", vbexclamation + vbokonly, "prompt"
'Msgbox "error no.:" & err. Number & vbcrlf _
& "Error Description:" & err. Description, vbcritical + vbokonly, "connection error"
Runsql = false
End Function
TIPS:
VB hyperlink import button
1. Definition
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
2. Use
ShellExecute me. hwnd, "open", "http://www.blogjava.net/wujun", vbnullstring, vbnullstring, vbnormalfocus
Textbox
Only numbers can be entered:
Private sub text2_keypress () sub text2_keypress (keyascii as integer)
Dim A as Boolean
A = CHR (keyascii) like "[0-9]" or keyascii = 8
If a = false then
Keyascii = 0
Msgbox "here we enter numbers! ", Vbinformation + vbokonly," prompt"
End if
End sub