请问在用vb做图书管理系统时 怎么做使删除记录后 数据库重新排列一边!就是说 :
1.sadasd asdasdas asddasd asdsadasd
2.asda   asdsd    adwqeq  dfgfdgdfgdfgd
3.uyiiuo qweqwere cxvvb   lkjkljkljljk
当删除第二条信息时 变为:
1.sadasd asdasdas asddasd asdsadasd
2.uyiiuo qweqwere cxvvb   lkjkljkljljk
而不是这样:
1.sadasd asdasdas asddasd asdsadasd
3.uyiiuo qweqwere cxvvb   lkjkljkljljk
就是让他自动排列一下!

解决方案 »

  1.   

    哦 我知道了 对了 小弟还有个问题想一同请教下 
    Call Module1.con
    Dim finddata1 As String
    Dim finddata2 As String
    Dim n As Double
    Dim m As Double
    If Option1.Value = True Then
      n = Val(DataCombo1.Text)
      m = Val(DataCombo2.Text)
      sqlfind = "select * from booklogin where 编号 Between '" & n & "'" & "and" & "'" & m & "'"
    End If
    If Option2.Value = True Then
     finddata1 = Format(CDate(DataCombo3.Text))
     finddata2 = Format(CDate(DataCombo6.Text))
     sqlfind = "select * from booklogin where 购买日期 > '" & "#" & finddata1 & "#" & "'" And "购买日期 < '" & "#" & finddata2 & "#" & "'"
    End If
    Rs.Open Conn, sqlfind, adOpenDynamic, adLockPessimistic
    Set DataGrid1.DataSource = rs
    DataGrid1.Refresh
    小弟想做个 用语句查询然后在datagrid控件中显示的东西 但是不知怎么会事上边代码运行后 我点下查询
    错误: 
    参数类型不正确!!!!!!!!!!
      

  2.   

    参数类型不正确是你的SQL语句不正确,你可以debug.print sql,然后作分析...
      

  3.   

    Call Module1.con
    Dim finddata1 As String
    Dim finddata2 As String
    Dim n As Double
    Dim m As Double
    If Option1.Value = True Then
      n = Val(DataCombo1.BoundText)
      m = Val(DataCombo2.BoundText)
      sqlfind = "select * from booklogin where 编号 Between '" & DataCombo2.BoundText & "'" & "and" & "'" & DataCombo1.BoundText & "'"
    End If
    If Option2.Value = True Then
     finddata1 = Format(CDate(DataCombo3.Text))
     finddata2 = Format(CDate(DataCombo6.Text))
     sqlfind = "select * from booklogin where 购买日期 > '" & "#" & finddata1 & "#" & "'" And "购买日期 < '" & "#" & finddata2 & "#" & "'"
    End If
    rs.Open sqlfind, conn, adOpenDynamic, adLockPessimistic
    Adodc1.RecordSource = "select * from booklogin where 编号 Between '" & n & "'" & "and" & "'" & m & "'"
    conn.Close
    Set DataGrid1.DataSource = rs
    DataGrid1.Refresh
    代码运行后为什么 不显示记录 请高手教下!!!!!!!!!!!!!!!!! dategrid控件!!!!!
      

  4.   

    用了ADO对象,就不要用ADODC控件啊rs.CursorLocation = adUseClient
    rs,open
    rs.Open sqlfind, conn, adOpenDynamic, adLockPessimistic 
    'Adodc1.RecordSource = "select * from booklogin where 编号 Between '" & n & "'" & "and" & "'" & m & "'"      '<---这句不要了
    'conn.Close  
    Set DataGrid1.DataSource = rs 
    DataGrid1.Refresh 
      

  5.   

    上面错了:
    rs.CursorLocation = adUseClient 
    rs.Open sqlfind, conn, adOpenDynamic, adLockPessimistic 
    'Adodc1.RecordSource = "select * from booklogin where 编号 Between '" & n & "'" & "and" & "'" & m & "'"      ' <---这句不要了 
    'conn.Close  
    Set DataGrid1.DataSource = rs 
    DataGrid1.Refresh 
      

  6.   

    Call Module1.con
    Dim finddata1 As String
    Dim finddata2 As String
    Dim n As Double
    Dim m As Double
    If Option1.Value = True Then
      n = Val(DataCombo1.BoundText)
      m = Val(DataCombo2.BoundText)
      sqlfind = "select * from booklogin where 编号 Between '" & n & "'" & "and" & "'" & m & "'"
    End If
    If Option2.Value = True Then
     finddata1 = Format(CDate(DataCombo3.Text))
     finddata2 = Format(CDate(DataCombo6.Text))
     sqlfind = "select * from booklogin where 购买日期 > '" & "#" & finddata1 & "#" & "'" And "购买日期 < '" & "#" & finddata2 & "#" & "'"
    End If
    rs.CursorLocation = adUseClient
    rs.Open sqlfind, conn, adOpenDynamic, adLockPessimistic
    'conn.Close
    Set DataGrid1.DataSource = rs
    DataGrid1.Refresh
    各位大哥 请看下啊 点击查询后有记录显示但是一条空记录!!!!!!!!!!!!!!