Hi Bernard,
Thanks for the info, but I have tried this with the field list, and I still get an error on the value data. My statement after being built looks like this:
" Insert into temptable (col1) values ("BAR.0000")"
and it still thinks the value "BAR" is a column name.
Since this is Monday, I may just toss the program out the window and come back to it when I have settled down
.
>Hi Beth:
>
>You need a parameterized insert statement. Works well on any data type and even if your field values have quotes. I would do something like:
>
>>lcTableName = "tablename"
>lcFieldValues = "?pcFieldValue1, ?pcFieldValue2, ?pcFieldValue3"
>lcSqlStr = "insert into " + lcTableName + " values(" + lcFieldValues + ")"
>
>
>The field values are variables that must at least be private in scope.
>Also, in the insert statement I find it better to explicitly define the target fields. I.e.,
>>lcFieldList = "FieldName1, FieldName2, FieldName3"
>lcSqlStr = "insert into " + lcTableName + "(" + lcFieldList + ") " + ;
> "values(" + lcFieldValues + ")"
>
>
>HTH