我有下面的SQL,它正在使用OleDBConnection和OleDBCommand执行,并且它会永远消失并最终超时,我不知道为什么。在执行此脚本之前,其他人都会被执行并且它们没问题。我不知道这个有什么特别之处。
begin
insert into messages (message_id,message,store_in_log, message_group)
values (25000,'Production Floor','False','Locations');
insert into messages (message_id,message,store_in_log, message_group)
values (25001,'Building 4 – A','False','Locations');
insert into messages (message_id,message,store_in_log, message_group)
values (25002,'Building 3 – A','False','Locations');
insert into messages (message_id,message,store_in_log, message_group)
values (25003,'Building 4 – B','False','Locations');
insert into messages (message_id,message,store_in_log, message_group)
values (25004,'Building 4 – C','False','Locations');
insert into messages (message_id,message,store_in_log, message_group)
values (25005,'Building 4 – D','False','Locations');
insert into messages (message_id,message,store_in_log, message_group)
values (25006,'Quarantine','False','Locations');
insert into messages (message_id,message,store_in_log, message_group)
values (25007,'Small Area','False','Locations');
end;
带OLEDB连接的VB代码:
Dim sc As Script
Dim C As New OleDb.OleDbConnection(CnStr)
Dim Cmd As OleDb.OleDbCommand
Dim sql As String
For Each sc In s
sql = sc.OracleScript
Cmd = New OleDb.OleDbCommand(sql, C)
Try
Cmd.Connection.Open()
Cmd.ExecuteNonQuery()
Catch ex As Exception
Finally
Cmd.Connection.Close()
Cmd.Dispose()
Cmd = Nothing
End Try
Next