D
Davey
I am pulling my hair out with this...
I have a page that uses a stored procedure in an access database. This works
fine to retrieve the data I require. However, I then need to use another
query from the access database to return some further data. This is the bit
I cannot get to work...
If I comment out the second bit of code the page works fine, although not
displaying the data. If not commented out then I get the following error:
Error Type:
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
Code is as follows...
This is the first bit of code and just sets some variables..
<%
Dim strMainType_id
strMainType_id = Request.Form("ProductCategory")
Dim objRS, objComm, objParam
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = strConnect ' fill in the command properties
objComm.CommandText = "qryProduct_Category"
objComm.CommandType = adCmdStoredProc
Set objParam = objComm.CreateParameter("Find id", adVarChar, adParamInput,
50)
objComm.Parameters.Append objParam
objComm.Parameters("Find id") = strMainType_id
Set objRS = objComm.Execute
Set objComm = Nothing
Set objParam = Nothing
Set strMainType_id = Nothing
Dim MixerFlg, varMixer, FeedFlg, varFeed, FormingFlg, varForming
While Not objRS.EOF ' loop through the records from query and
display
if objRS("Mixing") <> "none" then
MixerFlg = True
Set varMixer = objRS("Mixing")
end if
if objRS("Feed") <> "none" then
FeedFlg = True
Set varFeed = objRS("Feed")
end if
if objRS("Forming") <> "none" then
FormingFlg = True
Set varForming = objRS("Forming")
end if
objRS.MoveNext
wend
objRS.MoveFirst
%>
Later on in the page I have this code...
' Search for Mixing equipment and display if an option
Dim objRS2, objComm2, objParam2
Set objComm2 = Server.CreateObject("ADODB.Command")
objComm2.ActiveConnection = strConnect ' fill in the command properties
objComm2.CommandText = "qryList_Equipment"
objComm2.CommandType = adCmdStoredProc
Set objParam2 = objComm2.CreateParameter("Find equip", adVarChar,
adParamInput, 50)
objComm2.Parameters.Append objParam2
objComm2.Parameters("Find equip") = varMixer
Set objRS2 = objComm2.Execute
Set objComm2 = Nothing
Set objParam2 = Nothing
if mixerFlg = true then
Response.Write objRS2("Title")
While Not objRS2.EOF ' now loop through the records
if objRS2("Title") = Mixer then
Response.Write "<INPUT TYPE=RADIO VALUE=" & vbquote & objRS2("Equipment_id")
& vbquote & " NAME=" & vbquote & objRS2("Title") & vbquote & ">" &
" " & objRS2("Description") & "<BR>"
end if
objRS2.MoveNext
Wend
end if
objRS2.Close
Set objRS2 = Nothing
I have a page that uses a stored procedure in an access database. This works
fine to retrieve the data I require. However, I then need to use another
query from the access database to return some further data. This is the bit
I cannot get to work...
If I comment out the second bit of code the page works fine, although not
displaying the data. If not commented out then I get the following error:
Error Type:
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
Code is as follows...
This is the first bit of code and just sets some variables..
<%
Dim strMainType_id
strMainType_id = Request.Form("ProductCategory")
Dim objRS, objComm, objParam
Set objComm = Server.CreateObject("ADODB.Command")
objComm.ActiveConnection = strConnect ' fill in the command properties
objComm.CommandText = "qryProduct_Category"
objComm.CommandType = adCmdStoredProc
Set objParam = objComm.CreateParameter("Find id", adVarChar, adParamInput,
50)
objComm.Parameters.Append objParam
objComm.Parameters("Find id") = strMainType_id
Set objRS = objComm.Execute
Set objComm = Nothing
Set objParam = Nothing
Set strMainType_id = Nothing
Dim MixerFlg, varMixer, FeedFlg, varFeed, FormingFlg, varForming
While Not objRS.EOF ' loop through the records from query and
display
if objRS("Mixing") <> "none" then
MixerFlg = True
Set varMixer = objRS("Mixing")
end if
if objRS("Feed") <> "none" then
FeedFlg = True
Set varFeed = objRS("Feed")
end if
if objRS("Forming") <> "none" then
FormingFlg = True
Set varForming = objRS("Forming")
end if
objRS.MoveNext
wend
objRS.MoveFirst
%>
Later on in the page I have this code...
' Search for Mixing equipment and display if an option
Dim objRS2, objComm2, objParam2
Set objComm2 = Server.CreateObject("ADODB.Command")
objComm2.ActiveConnection = strConnect ' fill in the command properties
objComm2.CommandText = "qryList_Equipment"
objComm2.CommandType = adCmdStoredProc
Set objParam2 = objComm2.CreateParameter("Find equip", adVarChar,
adParamInput, 50)
objComm2.Parameters.Append objParam2
objComm2.Parameters("Find equip") = varMixer
Set objRS2 = objComm2.Execute
Set objComm2 = Nothing
Set objParam2 = Nothing
if mixerFlg = true then
Response.Write objRS2("Title")
While Not objRS2.EOF ' now loop through the records
if objRS2("Title") = Mixer then
Response.Write "<INPUT TYPE=RADIO VALUE=" & vbquote & objRS2("Equipment_id")
& vbquote & " NAME=" & vbquote & objRS2("Title") & vbquote & ">" &
" " & objRS2("Description") & "<BR>"
end if
objRS2.MoveNext
Wend
end if
objRS2.Close
Set objRS2 = Nothing