Thanks for that, but I appear to still be having a problem, perhaps it's
because I've got a loop there?

        <!-- insert questions -->
        <cfloop index="i" from="1" to="#form.numberOfQuestions#">
        <cfquery name="InsertQuestion" datasource="user020">
        INSERT INTO tbl_020publicQuestions (interviewID, question)
        <cfqueryparam cfsqltype="CF_SQL_INTEGER" null="No"
value="#Val(InsertInterviewDetails.interviewID)#" />,
        <cfqueryparam cfsqltype="CF_SQL_VARCHAR" null="No"
value="#Trim(form['question' & i])#" />
        </cfquery>
        </cfloop>

The error getting returned is:

 Error Executing Database Query.
 [Macromedia][SQLServer JDBC Driver][SQLServer]Line 2: Incorrect syntax near
'@P1'.

And the other bit coming up on the error page is:

��  INSERT INTO tbl_020publicQuestions (interviewID, question) (param 1) ,
(param 2)

Thanks very much,

Saturday


On 24/4/05 8:04 pm, "Michael T. Tangorre" <[EMAIL PROTECTED]> wrote:

>> From: Stuart Kidd [mailto:[EMAIL PROTECTED]
>>   INSERT INTO tbl_020publicQuestions (interviewID, question)
>> VALUES (31, 'Oh, and i thought i'd written a lot but in fact
>> i hadn't written anything at all is that really that bad or
>> is that wrong?')
>> 319 :           <cfquery name="InsertQuestion" datasource="user020">
>> 320 :           INSERT INTO tbl_020publicQuestions
>> (interviewID, question)
>> 321 :           VALUES (#InsertInterviewDetails.interviewID#,
>> '#Evaluate('form.question' & i)#')
>> 322 :           </cfquery>
>> 323 :           </cfloop>
> 
> Use cfqueryparam and ditch the evaluate. See below:
> 
> <cfquery name="InsertQuestion" datasource="user020">
> INSERT INTO 
> tbl_020publicQuestions
> (
> interviewID,
> question
> )
> VALUES 
> (
> <cfqueryparam cfsqltype="CF_SQL_INTEGER" null="No"
> value="#Val(InsertInterviewDetails.interviewID)#" />,
> <cfqueryparam cfsqltype="CF_SQL_VARCHAR" null="No"
> value="#Trim(form['question' & i])#" />
> )
> </cfquery>
> 
> HTH,
> 
> Mike
> 
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:204192
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to