简体   繁体   English

ORA-00917:VB中缺少逗号错误

[英]ORA-00917: Missing Comma error in VB

I am having a lot of trouble trying to get some VB code to work in Excel, when trying to write to a DB. 尝试写入数据库时​​,尝试获取一些VB代码在Excel中工作时遇到很多麻烦。 I keep getting this comma error, but i cannot for the life of me see where the comma is missing...here is the code... 我一直收到这个逗号错误,但是我一生都看不到逗号缺失的地方...代码在这里...

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

I would greatly appreciate any help. 我将不胜感激任何帮助。

Thanks, Brett 谢谢,布雷特

Could one of your values have an embedded comma or, more likely, a quote? 您的价值观之一可能包含逗号,或者更可能是引号? That may screw up the resulting SQL string even though your building looks good. 即使您的建筑物看起来不错,也可能会弄乱产生的SQL字符串。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM