`
jackchen0227
  • 浏览: 146799 次
  • 性别: Icon_minigender_1
  • 来自: 帝都
社区版块
存档分类
最新评论

asp下链接数据库的各种语句

阅读更多
		<% 
			Response.Write "test" 
			Dim db                                      
			Set db=Server.CreateObject("ADODB.Connection") 
			'db.Open "Dbq=C:\Inetpub\wwwroot\wwwlink.mdb; Driver={Microsoft Access Driver (*.mdb)}"
			'db.Open "Dbq=C:\Inetpub\db\wwwlink.mdb; Driver={Microsoft Access Driver (*.mdb)}"
			'db.Open "Dbq=C:\db\wwwlink.mdb; Driver={Microsoft Access Driver (*.mdb)}"
			'db.Open "Dbq=" & Server.Mappath("wwwlink.mdb") & ";Driver={Microsoft Access Driver (*.mdb)}" 
			Dim conStr
			conStr="Driver={SQL Server}; Server=(local);UID=admin;PWD=000000;DATABASE=web;"
			db.open conStr 
			Dim sqlStr,rs
			sqlStr="select * from webInfo"
			set rs = db.Execute(sqlStr)
		%>
		<table border="1px">
			<%
				Do While Not rs.Eof
			%>
			<tr>
				<td><a href="sqlDelete.asp?id=<%=rs("link_id")%>">删除</a></td>
				<td><a href="sqlEdit.asp?id=<%=rs("link_id")%>">编辑</a></td>
				<td> <%=rs("name")%></td>
				<td> <%=rs("url")%></td>
				<td> <%=rs("intro")%></td>
			</tr>
			<%
				rs.MoveNext
				Loop
			%>
		</table>

 防止遗忘,特写博客

分享到:
评论
Global site tag (gtag.js) - Google Analytics