窗口中【添加】按钮的部分代码如下:
SqlStr = "INSERT INTO BridgeInfo"
   SqlStr = SqlStr & "(BridgeName,BridgeSpan,BridgeWidth,Load,Heigth,Foundation,Flood,Traffic,Location,Design,Build,Superintend,BuildDate,Re)"
   SqlStr = SqlStr & "VALUES ('" & Me.TxtName.Text & "',"
   SqlStr = SqlStr & "'" & Me.TxtLong.Text & "',"
   SqlStr = SqlStr & "'" & Me.TxtWidth.Text & "',"
   SqlStr = SqlStr & "'" & Me.TxtLoad.Text & "',"
   SqlStr = SqlStr & "'" & Me.TxtHeigth.Text & "',"
   SqlStr = SqlStr & "'" & Me.TxtFoundation.Text & "',"
   SqlStr = SqlStr & "'" & Me.TxtFlood.Text & "',"
   SqlStr = SqlStr & "'" & Me.TxtTraffic.Text & "',"
   SqlStr = SqlStr & "'" & Me.TxtLocation.Text & "',"
   SqlStr = SqlStr & "'" & Me.TxtDesign.Text & "',"
   SqlStr = SqlStr & "'" & Me.TxtBuild.Text & "',"
   SqlStr = SqlStr & "'" & Me.TxtSuperintend.Text & "',"
   SqlStr = SqlStr & "#" & Me.TxtDate.Value & "#,"
   SqlStr = SqlStr & "'" & Re & "');"
   Debug.Print SqlStr
   DBCn.Execute SqlStr
End IfMsgBox "添加成功", , "添加信息档案"
Adodc1.Refresh经查证,数据库BridgeInfo中可以添加相应记录,但是在DataGrid中显示的时出错,出现错误:下标越界