⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sql server开发技巧-12.htm

📁 微软数据库开发梦工场多媒体教学-sql server篇.rar,是多媒体教学的
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#000000" text="#FFFFFF">
<font color="#009900">Database Update - 用ASP编缉数据库记录 </font>
<p> </p>
<p>&lt;%' Defining some constants to make my life easier! (Same as Sample 1 &amp; 
  2)<br>
  ' Begin Constant Definition</p>
<p>' DB Configuration constants<br>
  ' Fake const so we can use the MapPath to make it relative.<br>
  ' After this, strictly used as if it were a Const.<br>
  Dim DB_CONNECTIONSTRING<br>
  DB_CONNECTIONSTRING = &quot;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=&quot; 
  &amp; Server.Mappath<br>
  (&quot;./db_scratch.mdb&quot;) &amp; &quot;;&quot;<br>
  ' We don't use these, but we could if we neeeded to.<br>
  'Const DB_USERNAME = &quot;username&quot;<br>
  'Const DB_PASSWORD = &quot;password&quot;</p>
<p>'Now we override the above settings to use our SQL server.<br>
  'Delete the following line to use the sample Access DB.<br>
  DB_CONNECTIONSTRING = Application(&quot;SQLConnString&quot;) &amp; &quot;UID=&quot; 
  &amp; Application(&quot;SQLUsername&quot;) <br>
  &amp; &quot;;PWD=&quot; &amp; Application(&quot;SQLPassword&quot;) &amp; &quot;;&quot;</p>
<p>' ADODB Constants<br>
  ' You can find these in the adovbs.inc file<br>
  ' Do a search for it and it should turn up somewhere on the server<br>
  ' If you can't find it you can download our copy from here:<br>
  ' http://www.asp101.com/samples/download/adovbs.inc<br>
  ' It may not be the most recent copy so use it at your own risk.<br>
  %&gt;<br>
  &lt;!-- #INCLUDE FILE=&quot;adovbs.inc&quot; --&gt;<br>
  &lt;%<br>
  ' End Constant Definition<br>
  %&gt;</p>
<p>&lt;%<br>
  Dim I ' Standard looping var<br>
  Dim iRecordToUpdate ' Id of deleted record</p>
<p>'We're going to keep this as simple as we can.<br>
  ' 1. Create a Recordset object<br>
  ' 2. Connect the Recordset to the table<br>
  ' 3. Find the record to update<br>
  ' 4. Update the record<br>
  ' 5. Update the table<br>
  ' 6. Close the Recordset</p>
<p>'Step 1:<br>
  Dim objRecordset<br>
  Set objRecordset = Server.CreateObject(&quot;ADODB.Recordset&quot;)</p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -