1、转换时间类型:

使用datavalue(rs("fbsj"))进行转换!
2、取字符串中的字符操作
一、从字符串左边取出2个字符:
1 dim stra
2 stra ="welcome"
3 stra=left(stra,2)
4 response.write(stra)
二、从字符串右边取出3个字符:2 stra ="welcome"
3 stra=left(stra,2)
4 response.write(stra)
1 dim stab
2 strb="come on baby"
3 strb=right(strb,3)
4 response.write(strb)
2 strb="come on baby"
3 strb=right(strb,3)
4 response.write(strb)
3、删除数据:
1
<%
2
If Request("Action")="Del" Then
3
Conn.Execute("Delete From dwzp Where did="&Request.querystring("did"))
4
Response.Redirect "zhaopingManager.asp?cid="&request.querystring("cid")
5
response.end
6
End If
7
%>
4、将数据库的值填充至table的做法:
2

3

4

5

6

7










































































其他页面要用的时候用<!--#include file="conn.asp"-->放至页面顶部就可以调用了
1 <%
2 dim conn,connstr,db
3 db="databases/syb.mdb"
4 Set conn = Server.CreateObject("ADODB.Connection")
5 connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
6 conn.Open connstr
7 sub closedb()
8 conn.close
9 set conn=nothing
10 end sub
11 %>
6、修改数据2 dim conn,connstr,db
3 db="databases/syb.mdb"
4 Set conn = Server.CreateObject("ADODB.Connection")
5 connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
6 conn.Open connstr
7 sub closedb()
8 conn.close
9 set conn=nothing
10 end sub
11 %>
1 <!--#include file="conn.asp"-->
2 <%
3 did=request.querystring("did")
4 strsql="select * from dwzp where did="&did
5 set rs=server.CreateObject("Adodb.Recordset")
6 rs.open strsql,conn,2,2
7 if request.QueryString("action")="Modify" then
8 txtzpzw=request("txtzpzw")
9 txtzpzy=request("txtzpzy")
10 txtzyyq=request("txtzyyq")
11 txtsex=request("txtsex")
12 txtage=request("txtagestart")&"-"&request("txtageend")
13 txtxlyq=request("txtxlyq")
14 txthkdz=request("txthkdz")
15 txtgzdz=request("txtgzdz")
16 txtgznx=request("txtgznx")
17 txtyx=request("txtyx")
18 txtgzfs=request("txtgzfs")
19 txtqtyq=request("txtqtyq")
20 rs("zpzw")=txtzpzw
21 rs("zpzy")=txtzpzy
22 rs("zyyq")=txtzyyq
23 rs("xbyq")=txtsex
24 rs("nlyq")=txtage
25 rs("xlyq")=txtxlyq
26 rs("hkszd")=txthkdz
27 rs("gzdd")=txtgzdz
28 rs("gznx")=txtgznx
29 rs("yx")=txtyx
30 rs("gzfs")=txtgzfs
31 rs("qtyq")=txtqtyq
32 rs.update
33 rs.close
34 Response.write "<Script>alert('企业职位招骋修改成功!');opener.location.reload();window.close();</Script>"
35 response.end
36 end if
37 %>
38
39 如果不是修改的话将取的数据填充table中
40 <tr>
41 <td> </td>
42 <td>*职业要求</td>
43 <td colspan="3"><textarea name="txtzyyq" cols="50" rows="5" id="txtzyyq"><%=rs("zyyq")%></textarea></td>
44 </tr>
45 <tr>
46 <td> </td>
47 <td>*性别要求</td>
48 <td width="182"><select name="txtsex" size="1" id="txtsex">
49 <option value="<%=rs("xbyq")%>" selected="selected"><%=rs("xbyq")%></option>
50 <option value="不限" >不限</option>
51 <option value="男">男</option>
52 <option value="女">女</option>
53 </select> </td>
54 <td width="82">*年龄要求</td>
55 <td width="216"><input name="txtagestart" type="text" id="txtagestart" size="3" maxlength="2" value="<%=left(rs("nlyq"),2)%>"/>
56 至
57 <input name="txtageend" type="text" id="txtageend" size="3" maxlength="2" value="<%=right(rs("nlyq"),2)%>" /></td>
58 </tr>
59 <tr>
60 <td> </td>
61 <td>*学历要求</td>
62 <td><select name="txtxlyq" size="1" id="txtxlyq">
63 <option value="不限">不限</option>
64 <option value="<%=rs("xlyq")%>" selected="selected"><%=rs("xlyq")%></option>
65 <option value="高中、技校">高中、技校</option>
66 <option value="中专">中专</option>
67 <option value="大专">大专</option>
68 <option value="本科">本科</option>
69 <option value="硕士">硕士</option>
70 <option value="博士">博士</option>
71
72 </select> </td>
73
74
7、添加数据2 <%
3 did=request.querystring("did")
4 strsql="select * from dwzp where did="&did
5 set rs=server.CreateObject("Adodb.Recordset")
6 rs.open strsql,conn,2,2
7 if request.QueryString("action")="Modify" then
8 txtzpzw=request("txtzpzw")
9 txtzpzy=request("txtzpzy")
10 txtzyyq=request("txtzyyq")
11 txtsex=request("txtsex")
12 txtage=request("txtagestart")&"-"&request("txtageend")
13 txtxlyq=request("txtxlyq")
14 txthkdz=request("txthkdz")
15 txtgzdz=request("txtgzdz")
16 txtgznx=request("txtgznx")
17 txtyx=request("txtyx")
18 txtgzfs=request("txtgzfs")
19 txtqtyq=request("txtqtyq")
20 rs("zpzw")=txtzpzw
21 rs("zpzy")=txtzpzy
22 rs("zyyq")=txtzyyq
23 rs("xbyq")=txtsex
24 rs("nlyq")=txtage
25 rs("xlyq")=txtxlyq
26 rs("hkszd")=txthkdz
27 rs("gzdd")=txtgzdz
28 rs("gznx")=txtgznx
29 rs("yx")=txtyx
30 rs("gzfs")=txtgzfs
31 rs("qtyq")=txtqtyq
32 rs.update
33 rs.close
34 Response.write "<Script>alert('企业职位招骋修改成功!');opener.location.reload();window.close();</Script>"
35 response.end
36 end if
37 %>
38
39 如果不是修改的话将取的数据填充table中
40 <tr>
41 <td> </td>
42 <td>*职业要求</td>
43 <td colspan="3"><textarea name="txtzyyq" cols="50" rows="5" id="txtzyyq"><%=rs("zyyq")%></textarea></td>
44 </tr>
45 <tr>
46 <td> </td>
47 <td>*性别要求</td>
48 <td width="182"><select name="txtsex" size="1" id="txtsex">
49 <option value="<%=rs("xbyq")%>" selected="selected"><%=rs("xbyq")%></option>
50 <option value="不限" >不限</option>
51 <option value="男">男</option>
52 <option value="女">女</option>
53 </select> </td>
54 <td width="82">*年龄要求</td>
55 <td width="216"><input name="txtagestart" type="text" id="txtagestart" size="3" maxlength="2" value="<%=left(rs("nlyq"),2)%>"/>
56 至
57 <input name="txtageend" type="text" id="txtageend" size="3" maxlength="2" value="<%=right(rs("nlyq"),2)%>" /></td>
58 </tr>
59 <tr>
60 <td> </td>
61 <td>*学历要求</td>
62 <td><select name="txtxlyq" size="1" id="txtxlyq">
63 <option value="不限">不限</option>
64 <option value="<%=rs("xlyq")%>" selected="selected"><%=rs("xlyq")%></option>
65 <option value="高中、技校">高中、技校</option>
66 <option value="中专">中专</option>
67 <option value="大专">大专</option>
68 <option value="本科">本科</option>
69 <option value="硕士">硕士</option>
70 <option value="博士">博士</option>
71
72 </select> </td>
73
74
1
<!--#include file="conn.asp"-->
2
<!--#include file="sybadmin/md5.asp"-->
3
<%
4
cid=request.QueryString("cid")
5
txtzpzw=request("txtzpzw")
6
txtzpzy=request("txtzpzy")
7
txtzyyq=request("txtzyyq")
8
txtsex=request("txtsex")
9
txtage=request("txtagestart")&"-"&request("txtageend")
10
txtxlyq=request("txtxlyq")
11
txthkdz=request("txthkdz")
12
txtgzdz=request("txtgzdz")
13
txtgznx=request("txtgznx")
14
txtyx=request("txtyx")
15
txtgzfs=request("txtgzfs")
16
txtqtyq=request("txtqtyq")
17
set rs=server.CreateObject("adodb.recordset")
18
sqlstr="select * from dwzp"
19
rs.open sqlstr,conn,1,3
20
rs.addnew
21
rs("cid")=cid
22
rs("zpzw")=txtzpzw
23
rs("zpzy")=txtzpzy
24
rs("zyyq")=txtzyyq
25
rs("xbyq")=txtsex
26
rs("nlyq")=txtage
27
rs("xlyq")=txtxlyq
28
rs("hkszd")=txthkdz
29
rs("gzdd")=txtgzdz
30
rs("gznx")=txtgznx
31
rs("yx")=txtyx
32
rs("gzfs")=txtgzfs
33
rs("qtyq")=txtqtyq
34
rs("fbsj")=now()
35
rs.update
36
response.Write"<script>alert('招骋职位发布成功!');window.location.href('qymain.asp?cid="&rs("cid")&"')</script>"
37
%>
8、取参数的值
2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

1
session("username")
2
request.querystring("id")
3
request("id")
4
request.form("文本框名")
5
9、弹出窗口操作完后,如何更新主页面

2

3

4

5

1 Response.write "<Script>alert('企业职位招骋修改成功!');opener.location.reload();window.close();</Script>"
2 response.end
2 response.end
10、向弹出窗口传递值
1
<a href="#" onClick="window.open('Editzhaopin.asp?did=<%=rs("did")%>','','width=640,height=580,scrollbars=yes')">
2
<%=strzpzw%>
3
</a>

2

3
