
strsql ="insert into kehu(company_name,beizhu) values ('"&txtEmp_name.Text &"','"beizhu.Text &"')"

 2007-04-29 14:49
	    2007-04-29 14:49
   2007-04-29 15:02
	    2007-04-29 15:02
   2007-04-29 15:14
	    2007-04-29 15:14
   2007-04-29 15:21
	    2007-04-29 15:21
  再请教一问题:在公共模块中添加如下代码:
Option Explicit
Public dbconn As New ADODB.Connection
Public loginuser As String
Public loginOK As Boolean
Public cmdtype As String
Public tuser_id As String
Public tdept_id As Integer
Public temp_id As Integer
Public tcheck_ym As String
Public tqx As String
Sub main()
 If connecttodatabase = False Then
    MsgBox "联接数据库出错!"
    End
 End If
 
 loginOK = False
 
 cmdtype = " "
 frmLogin.Show vbModal
 Unload frmLogin
 
 If loginOK Then
     MDIForm1.Show
     
 End If
 
 End Sub
 '联接到数据库
 
 Function connecttodatabase() As Boolean
    On Error GoTo err_conn
    
    
    '设置服务器名称,数据库名称,登录名(此时密码为空)
 dbconn.ConnectionString = "dsn=rsgl;database=kehu;uid=admin;pwd="
    
    dbconn.Open
    
    
    connectodatabase = True
    Exit Function
    
err_conn:
    connecttodatabase = False
    
    
        
End Function
我想请教一下红色字体在代码中的意义。
我运行了一下上面的代码,发现出现错误,说这个frmLogin变量未定义。
我不明白。请教各位了。谢谢 !

 2007-04-29 16:46
	    2007-04-29 16:46
   2007-04-29 17:20
	    2007-04-29 17:20
  继续请教一下:
   我在ACCESS里面只有一个表kehu,字段是公司名称、编号(自动编号)和备注
现在,我在查询窗口中设置查询公司名称,用模糊查询,那查询语句该怎么写啊?
是不是: select * from 新增 where kehuadd.columnname like '%'
      (“新增”为主窗体菜单中的顶级菜单,名称为kehu)
谢谢各位了 !!!

 2007-04-30 15:02
	    2007-04-30 15:02
   2007-04-30 16:10
	    2007-04-30 16:10