日记首页  | 列表 | 添加日记  | 管理登陆  | 搜索 | 退出 直达底部 
****************************************
2018/12/23《asp,数据库,部分不显示》

asp,数据库,读取显示

      原句:
      <td align="center" nowrap="nowrap" bgcolor="#FFFFFF"><input type="text" name="address size="8" value="<%=rs("address")%>" /></td>


      如果这句全部删除,此列网页不显示


      不显示数据,但保留表格
      <td align="center" nowrap="nowrap" bgcolor="#FFFFFF"><input type="text" size="8" /></td>


      不显示数据,也不保留表格,但保留此列
      <td align="center" nowrap="nowrap" bgcolor="#FFFFFF"></td>


      不显示数据,此列变灰色
      <td></td>


****************************************
2018/12/22《vba跳转,vba跳过代码》

GoTo、On…GoTo语句

1.GoTo语句

无条件地跳转到程序的某个标记,此标记可以利用任何字符组合,以字母开头,以冒号结尾。

2.On…GoTo语句

如果希望根据表达式的结果而决定跳转到某个标记处,需要利用On…GoTo语句,语句法如下:

On expression GoSub destinationlist

On expression GoTo destinationlist


首选:

GoTo Skip

 ................     ' 不会被执行

Skip


GoTo LastLine
 ................     ' 不会被执行
    
LastLine:   ' 接GoTo LastLine 完成


示例:

Sub GotoStatementDemo()
Dim Number, MyString
    Number = 1     ' 设置变量初始值。
    ' 判断 Number 的值以决定要完成那一个程序区段(以“程序标签”来表式)。
    If Number = 1 Then GoTo Line1 Else GoTo Line2
   
Line1:
    MyString = "Number equals 1"
    GoTo LastLine    ' 完成最后一行。
Line2:
    ' 下列的语句根本不会被完成。
    MyString = "Number equals 2"
LastLine:   ' 接GoTo LastLine 完成
     Debug.Print MyString    ' 将“"Number equals 1"”显示在“立即”窗口。
End Sub

****************************************
2018/12/19《电子锁,指纹锁,密码锁》
010:321456
****************************************
2018/12/19《电子密码锁指纹锁》
管理账号
001:683125
002:左手
003:右手
****************************************
2018/12/18《asp,简易记事本修改》

asp,简易记事本,

目的:改变事态后,显示未处理

原:
Response.write"<script>alert('事件状态修改成功。');location.href='txt.asp'</script>"

修改为:
Response.write"<script>alert('事件状态修改成功。');location.href='txt.asp?list=false'</script>"

****************************************
2018/12/18《数据库按顺序显示》

asp 将Access数据库某列的内容按顺序的显示在某张网页上

order by id desc 为降序
order by id asc 为升序   
id为数据库排列,可以任意(如data)

列:<降序>

在20日记中:
sql="select * from [day] order by id DESC"

在40简易记事本中:<原为:.........order by id">
sql="select * from jishi order by id desc"
elseif request("list")="true" then
sql="select * from jishi where ok=true order by id desc"
elseif request("list")="false" then
sql="select * from jishi where ok=false order by id desc"


****************************************
2018/12/8《vba中单元格位置对齐技巧》

Sub 单元格对齐技巧()
    Dim myRange As Range
    Set myRange = Range("A1")             '指定任意单元格Cells(ii, j) 替换变量
    With myRange
        .Value = "ExcelVBA实用技巧大全"   "复制代码时,不要MsgBox
        .HorizontalAlignment = xlRight
        MsgBox "水平右对齐。"
        .HorizontalAlignment = xlLeft
        MsgBox "水平左对齐。"
        .HorizontalAlignment = xlCenter
        MsgBox "水平居中。"
        .HorizontalAlignment = xlDistributed
        MsgBox "水平分散对齐。"
        .VerticalAlignment = xlTop
        MsgBox "垂直靠上。"
        .VerticalAlignment = xlBottom
        MsgBox "垂直靠下。"
        .VerticalAlignment = xlCenter
        MsgBox "垂直居中。"
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlGeneral
        MsgBox "恢复默认。"
    End With
    Set myRange = Nothing
    End Sub


    With Selection
        ActiveSheet.UsedRange.HorizontalAlignment = xlRight  '对已用区域右对齐
    End With

****************************************
2018/12/8《单元格标注成红色》

vba,单元格标注成红色,(ii 和 j)为变量

单元格底色设置为红色(填充)

Cells(ii, j).Interior.Color = vbRed




VBA,设置字体颜色(Cells 和 Range 的区别)

Cells(ii, j).Font.Color = vbRed      '(ii 和 j)为变量

Range("A1").Font.Color = vbRed    'A1单元格



设置字体加粗

Cells(ii, j).Font.Bold = True



****************************************
2018/12/7《删除空白列代码,汇总变量J列》


Sub 删除空白列代码()
Application.ScreenUpdating = False
   For i = 1 To 50      '删除第一行“剩余课时”列
    If Cells(1, i) = "剩余课时" Then
        Columns(i).Delete
    End If
   Next      '删除“剩余课时列代码结束

 Dim iC&, x&
 iC = Cells(1, 256).End(xlToLeft).Column
 For x = iC To 1 Step -1
 If Cells(3, x) = "" And Cells(4, x) = "" And Cells(5, x) = "" And Cells(6, x) = "" And Cells(7, x) = "" And Cells(4, x) = "" And Cells(5, x) = "" And Cells(8, x) = "" And Cells(9, x) = "" And Cells(10, x) = "" And Cells(11, x) = "" And Cells(12, x) = "" And Cells(13, x) = "" And Cells(14, x) = "" And Cells(15, x) = "" And Cells(16, x) = "" And Cells(17, x) = "" And Cells(18, x) = "" Then Columns(x).Delete

Next x

For j = 1 To 40      '寻找“已上课时”列的循环
    If Cells(1, j) = "已上课时" Then
    ii = Range("A65536").End(xlUp).Row() + 1 '定位到A列最后一行的下一行,ii
   
For iii = 3 To Range("A65536").End(xlUp).Row()
     Cells(ii, j - 1) = "合计:"
     Cells(ii, j).Value = Application.WorksheetFunction.Sum(Range(Cells(2, j), Cells(iii, j)))                '列汇总
    
     Next
    End If
 
Next
Application.ScreenUpdating = True
End Sub


 Cells(ii, j).Value = Application.WorksheetFunction.Sum(Range(Cells(2, j), Cells(iii, j)))                '列汇总

这句是汇总变量J列的代码,也要给iii赋值:

For iii = 3 To Range("A65536").End(xlUp).Row()




****************************************
2018/12/5《win10邮箱设置》
win10邮箱设置:
最重要的是密码不是邮箱登录密码,而是认证密码
4269259hjt
  共有日记411篇,每页10篇,分29/42页   9首页 3上页 下页4 尾页:  转到: