LoginSignup
0
0

vbsの作法 その74

Posted at

概要

vbsの作法、調べてみた。
練習問題、やってみた。

練習問題

htaで、mdbにinsertせよ。

サンプルコード


<html>
<head>
	<title>mdb sql run</title>
	<HTA:APPLICATION SHOWINTASKABAR="no" WINDOWSSTATE="maximize" />
</head>
<body bgcolor="#ffddCC">
	<h1> mdb sql up</h1>
	<p>
		url: <input type="text" id="a" size="50" value="https://qiita.com/"><br>
	</p>
	<p>
		titel: <input type="text" id="b" size="50" value="tetle"><br>
	</p>
	<p>
		body: <input type="text" id="c" size="100" value="body"><br>
	</p>
	<p>
		itime: <input type="text" id="d" size="20" value="4"><br>
	</p>
	<p>
		<input id="Button1" type="button" value=" 挿入 " />
	</p>
<script language="vbscript">
Sub Button1_onClick
	Dim SQL
	With CreateObject("ADODB.Connection")
		.Open "Provider=MSDASQL;Driver={Microsoft Access Driver (*.mdb)};DBQ=db1.mdb"
		SQL = "INSERT INTO b_date(url,title,body,itime) VALUES('" & a.value & "','" & b.value & "','" & c.value & "','" & d.value & "');"
		.Execute(SQL)
		.Close
		msgbox "ok"
	End With
End Sub
d.value = date()
</script>
</body>
</html>




以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0