易截截图软件、单文件、免安装、纯绿色、仅160KB

vb操作sql数据库的典型例子

本程序有一菜单开始,里面有查询,删除,修改,添加,程序不一一列出,只写出基本的过程,连接数据库采用标准模块:
'Public publicstr As String
Public conn As ADODB.Connection
Public rs As ADODB.Recordset
Public Sub main()     '数据库连接共享函数
  Set conn = New ADODB.Connection
  conn.Open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=plgl;Initial Catalog=plgl"
  'publicstr = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=plgl;Initial Catalog=plgl"     '共享连接字符串
  main_pfm.Show
End Sub
添加程序:
  Set rs = New ADODB.Recordset
  If Trim(Text1(0).Text) = "" Then
    smeg = "配方号不能为空!!!"
    MsgBox smeg, vbOKCancel + vbExclamation, "警告"
    Text1(0).SetFocus
  Else
  If Not IsNumeric(Text1(0).Text) Then
          smeg = "A添加剂非数字!!!"
          MsgBox smeg, vbOKCancel + vbExclamation, "警告"
          Text1(0).Text = ""
          Text1(0).SetFocus
    Else
    If Trim(Text1(1).Text) = "" Then
      smeg = "配方名称不能为空!!!"
      MsgBox smeg, vbOKCancel + vbExclamation, "警告"
      Text1(1).SetFocus
    Else
      If Trim(Text1(2).Text) = "" Then
        smeg = "A添加剂不能为空!!!"
        MsgBox smeg, vbOKCancel + vbExclamation, "警告"
        Text1(2).SetFocus
      Else
        If Not IsNumeric(Text1(2).Text) Then
      &n


相关文档:

VB中字符串匹配的多种方式

   这段时间在移植项目的过程中,起初我想判断一个字符串中是否存在某字符(串),直接的使用方法是用instr(start,string1,string2,VB compare),但经过分析在VB中可以只用一下方法来判断!
   1.常用的INStr方法
    Function InStr([Start], [String1], [String2], [Compare A ......

VB 6.0使用api

这一段大家编写程序很多时候都在使用API,它给我们带来了强大的功能.让我们非常惊喜.
但是我们在调试程序的时候有时候总会奔溃.这样很不方便.
其中有些是api惹的祸
使用api注意事项:
首先我说说我的观点.
1:Api是很多系统也在用.我们在设置参数时如果和系统的参数有冲突.就可能引起软件出错
2.api很多都是c语言编写的, ......

vb自动关机程序

Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Const EWX_LOGOFF = 0
Private Const EWX_SHUTDOWN = 1
Private Const EWX_REBOOT = 2
Private Const EWX_FORCE = 4
Private closeTime As String
Sub AdjustTokenPrivilegesForNT()
  ......

VB显示透明FLASH效果

VB显示透明FLASH效果
  演示效果:
 
    代码如下:
公共声明区域
Option Explicit
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetW ......

VB实现“木马”式隐形运行程序

程序隐形的原理
  对于一个隐形程序而言,最基本的要求是:
  1. 不在桌面出现界面;
  2. 不在任务栏出现图标;
  3. 程序名从任务管理器名单中消失。
Public Declare Function GetCurrentProcessId Lib “kernel32” () As Long
’获得当前进程ID函数的声明
Public Declare Functio ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号