在尝试写入数据库时,我在尝试让一些 VB 代码在 Excel 中工作时遇到了很多麻烦。我不断收到这个逗号错误,但我无法终生看到逗号丢失的地方......这是代码......
While Not IsEmpty(startRange.Offset(i, 0))
tentype = startRange.Offset(i, 0).Value
tendelivery = "EMAIL"
tenevent = startRange.Offset(i, 1).Value
tentext = startRange.Offset(i, 2).Value
tensubject = startRange.Offset(i, 3).Value
tentrailer = startRange.Offset(i, 4).Value
tenlanguage = startRange.Offset(i, 5).Value
tenid = 10 + i
With objCommand
.ActiveConnection = "Driver={Microsoft ODBC for Oracle};Server=*;Uid=*;Pwd=*"
.CommandText = "INSERT INTO TEN_TEMPLATE VALUES (" & tenid & ", " & tendelivery & ", " & tentype & ", " & tenevent & ", " & tentext & ", " & tenlanguage & ", " & tensubject & ", " & tentrailer & ")"
.Execute
End With
i = i + 1
Wend
我将不胜感激任何帮助。
谢谢,布雷特