私はdb2テーブルにレコードを挿入しようとしており、response.writeで結果を取得しています。応答はInsertOKですが、レコードがテーブルに挿入されていません。私が使用するコードは次のとおりです。
<%
dim connection
dim sSQL, sConnString
sSQL="INSERT INTO db.tablename (LOGON,CREATION_DATE,CREATOR) VALUES ('logonTest','2012- 06-20-12.00.00.000000','blabla')"
sConnString="data source=blabla;user id=jhonsonjack;password=mypassword"
Set connection = Server.CreateObject("ADODB.Connection")
connection.Open(sConnString)
On Error Resume Next
connection.execute(sSQL)
if Err.number<>0 or connection.Errors.Count <> 0 Then
response.write "Insert Failed"
else
response.write "Insert OK"
end if
On Error Goto 0
Connection.Close
Set Connection = Nothing
%>
何が悪いのかについて何か考えはありますか?
アップデートとして、私の挿入物はほぼ正常に機能しています。私はほとんど言いますが、テーブルに4つのレコードを挿入しようとしますが、このコードは最初の2つの「挿入」のみを処理し、その理由がわかりません。
<%
dim connection
dim sSQL
dim sConnString
sSQL="INSERT INTO XXXXX.XXXXX(LOGON,CREATION_DATE,CREATOR,ACCOUNT_TYPE,TO_DISABLE,APPLICATION_NAME,ACCOUNT_MODEL,DESCRIPTION,OWNER,FAC_SECURITY,CUPID,REG_FORM,CFIRM_DATE,TO_DELETE,DOCLINK) VALUES ('XXXXX','XXXXX','XXXXX','XXXXX','0','XXXXX','4','XXXXX','XXXXX','XXXXX','XXXXX','0','XXXXX','','XXXXX');INSERT INTO XXXXX.XXXXX (LOGON,CREATION_DATE,CREATOR,ACCOUNT_TYPE,TO_DISABLE,APPLICATION_NAME,ACCOUNT_MODEL,DESCRIPTION,OWNER,FAC_SECURITY,CUPID,REG_FORM,CFIRM_DATE,TO_DELETE,DOCLINK) VALUES ('XXXXX','XXXXX','XXXXX','XXXXX','0','XXXXX','4','XXXXX','XXXXX','XXXXX','XXXXX','0','XXXXX','','XXXXX');INSERT INTO XXXXX.XXXXX (LOGON,CREATION_DATE,CREATOR,ACCOUNT_TYPE,TO_DISABLE,APPLICATION_NAME,ACCOUNT_MODEL,DESCRIPTION,OWNER,FAC_SECURITY,CUPID,REG_FORM,CFIRM_DATE,TO_DELETE,DOCLINK) VALUES ('XXXXX','XXXXX','XXXXX','XXXXX','0','XXXXX','4','XXXXX','XXXXX','XXXXX','XXXXX','0','XXXXX','','XXXXX');INSERT INTO XXXXX.XXXXX (LOGON,CREATION_DATE,CREATOR,ACCOUNT_TYPE,TO_DISABLE,APPLICATION_NAME,ACCOUNT_MODEL,DESCRIPTION,OWNER,FAC_SECURITY,CUPID,REG_FORM,CFIRM_DATE,TO_DELETE,DOCLINK) VALUES ('XXXXX','XXXXX','XXXXX','XXXXX','0','XXXXX','4','XXXXX','XXXXX','XXXXX','XXXXX','0','XXXXX','','XXXXX');"
sConnString="data source=XXXXX;user id=XXXXX;password=XXXXXXXXXX"
Set connection = Server.CreateObject("ADODB.Connection")
connection.Open(sConnString)
set rs = connection.execute(sSQL)
if Err.number<>0 or connection.Errors.Count <> 0 Then
response.write "Insert Failed"
else
response.write "Insert OK" %><br><% response.write sSQL
end if
Connection.Close
%>
そこに何が悪いのかについて何か考えはありますか?