What-a-Tool wrote:
> Yes - when I enter the data direcrly thru a query within the Access
> program, or thru asp with the standard sql string with values
> concatenated in, everything is entered as it should be.
>
> I have several different data types that I am lumping together within
> this parameters array - String, Boolean, single, short integer, and
> date. The error message I am getting is that my data "is of the wrong or
> conflicting types, or outside acceptable bounds". I notice that
> entering with the parameter method, there doesn't seem to be any way
> to enclose the data type with '...' or #...#. Could this have
> something to do with it?
No. Delimiters are not needed when using parameters. Here is a repro showing
the passing of all of these parameter types (this is tested code which ran
without error for me):
<%
dim cn, cmd, arParms, sSQL, rs, sHTML
sSQL="CREATE TABLE InsertTest (" & _
"IntCol smallint," & _
"BoolCol bit," & _
"TextCol CHAR(15)," & _
"DateCol datetime," & _
"SngCol real)"
set cn = CreateObject("ADODB.Connection")
'substitute your database in the following string
cn.Open "provider=microsoft.jet.oledb.4.0;data source=" & _
server.MapPath("db7.mdb")
cn.Execute sSQL,,129
sSQL= "INSERT INTO InsertTest(IntCol,BoolCol,TextCol," & _
"DateCol,SngCol) VALUES (?,?,?,?,?)"
arParms=array(25,true,"test",#2005-03-22#,1.25)
set cmd=createobject("adodb.command")
cmd.CommandText=sSQL
set cmd.ActiveConnection=cn
cmd.Execute ,arParms,129
set cmd=nothing
sSQL="select IntCol,BoolCol,TextCol," & _
"DateCol,SngCol from InsertTest"
set rs=cn.Execute(sSQL,,1)
sHTML=rs.getstring(2,,"</td><td>","</td></tr><tr><td>")
rs.close:set rs=nothing
cn.Close:set cn=nothing
Response.Write "<table border=""1""><tr><td>"
Response.Write left(sHTML,len(sHTML)-

Response.Write "</table>"
%>
BTW, you may be interested in going to the next level: saved parameter
queries. The code is even easier to write than the Command object code. See:
http://groups-beta.google.com/group/...d322b882a604bd
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"