Johnd said:
Anyway I have tried switching to native OLE, (so far unsuccessful)
and have yet to find any good reference to using parameters on
advantage 6.2 for Novell. I have rewritten my routine to truncate
anything over 1024 chars and create a new record with this data.
Since this is only tracking info, it doesn't matter, but I will need
a solution because I have other memo fields that I can't just
truncate.
Here is a way to parameterize your dynamic sql statement:
'you will need to define the constants used, either by including the
'adovbs.inc file, or by using the method described here:
http://www.aspfaq.com/show.asp?id=2112
strQuery = "insert into NCRheadcomments (hdrcomid, " & _
"headerid,comdate,userid, comments, comtime) " &_
"values(10084,10080, ?,?,?,?)"
Set cmd = server.createobject("adodb.command")
cmd.CommandType = 1 'adCmdText
set cmd.ActiveConnection = conn
set params = cmd.Parameters
with cmd
'here is where I will have trouble. I am not sure of the proper
datatype mappings for the Advantage datatypes. See here
'for the mappings for various other databases:
http://www.able-consulting.com/ADODataTypeEnum.htm
'Here are my guesses:
params.append .CreateParameter("Date",adVarChar, _
adParamInput, 8, FormatDateTime( Date(), VBshortDate))
params.append .CreateParameter("User",adVarChar, _
adParamInput, 50, session("CurrentUser"))
params.append .CreateParameter("Comment",adLongVarChar, _
adParamInput, 50, CurrentComment)
params.append .CreateParameter("Time",adVarChar, _
adParamInput, 8, time)
..Execute ,,adExecuteNoRecords
end with
Now, you MAY need to use AppendChunk to set the value of the Comment
parameter. I am not sure. Give this a try without using AppendChunk.
Bob Barrows