【发布时间】:2014-01-12 15:43:58
【问题描述】:
SQL 插入语句给出 3134 运行时错误。为什么?
Private Sub Command0_Click()
Open "C:\Users\steven.EOPESTATE\Desktop\Sharp Sales\TRMSAVE01.txt" For Input As #1
Do Until EOF(1)
Dim TranSQL As String
Line Input #1, varLine
testvarline = Split(varLine, ",")
If testvarline(0) = "$Tran" Then
Debug.Print testvarline(0), testvarline(1), testvarline(2), testvarline(3), testvarline(4), testvarline(5), testvarline(6), testvarline(7), testvarline(8), testvarline(9)
TranSQL = "Insert into Transaction ([Tran ID], [1], [2], [3], [4], [5], [6], [Date], [Time], [9]) Values (testvarline(0), testvarline(1),testvarline(2),testvarline(3),testvarline(4), testvarline(5),'testvarline(6)',# " & Format(testvarline(7), "MM/DD/YY") & "#,# " & Format(testvarline(8), "HH:MM:SS") & "#,testvarline(9)"
DoCmd.RunSQL TranSQL
End If
Loop
Close #1
【问题讨论】: