Solved

What error is this??

Posted on 2001-06-13
16
203 Views
Last Modified: 2008-02-01
Hello,
 I am trying to make a small application.I have the main screen on which a form is displayed with a drop down box and a radio button.
 Once the user select the number from the drop down and clicks the radio button and submit, the  following script is to be executed.
 Now this refers to an access query where i am to pass two parameters.However when i execute the script with the following code:

<html>
<head>
 <title> Auction Details</title>
</head>

<body>
<%

 dim conn,rs,comm
 set comm=server.createobject("adodb.command")
 set conn=server.createobject("adodb.connection")
 set rs=server.createobject("adodb.recordset")

 conn.open "DSN=mydbase"

 comm.activeconnection=conn
 comm.commandtext="details"
 comm.commandtype=2

 comm.Parameters.Append comm.createparameter ("abc",adInteger,adparameterinput)

comm.parameters.append comm.createparameter("xyz",advarchar,adparameterinput)
comm.parameters(0).value=request.querystring("number")
comm.parameters(1).value=request.querystring("radio")
set rs=comm.execute

(PS this is just part of the script and i strongly feel that the error is coming from here.)

When i execute the script i get the following error:

ADODB.Command error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

/man/list.asp, line 26

Please help me resolve this problem
The datatypes in the database are
integer and text


0
Comment
Question by:smash81
  • 6
  • 6
  • 3
  • +1
16 Comments
 
LVL 20

Expert Comment

by:Silvers5
ID: 6185256
1at.. if it's an access database you shouldn't pass parameters, besides what are you trying to do here?

do it this way

StrSQL = "INSERT INTO [Table name] (Fielad1,Field2) values(" & request.querystring("number")
 & ",'" & request.querystring("radio")
 & '")

conn.execute(StrSQL)

or StrSQL = "Select * From [TABLENAme] where [Numeric Field/ Numeric Column Name]=" & request.querystring("number") & " AND [Text Field/ Text Column Name]='" & request.querystring("radio") & "'"
Set rs = conn.Execute(StrSQL)



0
 
LVL 3

Expert Comment

by:dragosh
ID: 6185561
if you are trying to execute a stored procedure you must set CommandType to adCmdStoredProc(=4)

and i think the names of your procedure's parameters are wrong : "abc" , "xyz" .. should be "@abc" and "@xyz"

and one more thing , method CreateParameter has 5 parameters :

command.CreateParameter (Name, Type, Direction, Size, Value)

0
 
LVL 20

Expert Comment

by:Silvers5
ID: 6185616
Access doesn't support stored procedures..

0
 
LVL 3

Expert Comment

by:dragosh
ID: 6185638
i know .. who is talking about Access ???
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 6185670
>Now this refers to an access query where i am to pass two parameters
0
 
LVL 3

Expert Comment

by:dragosh
ID: 6185682
oh ... my mistake , next time i must read with more attention :)
0
 
LVL 3

Expert Comment

by:nigelrowe
ID: 6185692
>Now this refers to an access query...

But does it mean MS Access, or, access in general?
0
 

Author Comment

by:smash81
ID: 6185699
Yes it is an acess database.Does acess have some problems when you pass parameters?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 20

Expert Comment

by:Silvers5
ID: 6185751
to what you're passing parameters? a macro?
0
 

Author Comment

by:smash81
ID: 6185766
Yes it is an acess database.Does acess have some problems when you pass parameters?
0
 

Author Comment

by:smash81
ID: 6185774
Its a query.
0
 

Author Comment

by:smash81
ID: 6185788
Its a query.
0
 

Author Comment

by:smash81
ID: 6185794
Its a query.
0
 
LVL 20

Accepted Solution

by:
Silvers5 earned 30 total points
ID: 6185834
a view.. you want to fetch records from the query then do as I typed..

your way is to pass parameters to an SQL stored procedure!

what's the query name? details

then

StrSQL = "Select * From details where abc =" & request.querystring("number")
& " AND xyz='" & request.querystring("radio") & "'"
Set rs = conn.Execute(StrSQL)

I supposed abc is the numeric field in the query and xyz the text field
0
 

Author Comment

by:smash81
ID: 6186237
Now i have tried using the command.parameters.refresh command and i am getting the following error


Microsoft OLE DB Provider for ODBC Drivers error '80040e51'

Provider cannot derive parameter information and SetParameterInfo has not been called


Now what is this????
0
 
LVL 20

Expert Comment

by:Silvers5
ID: 6186418
:o/
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Grab data from remote page 10 60
Voice recognition ASP or ASP.NET or JavaScript 2 60
Summernote and form validation 10 93
Change visitor's REMOTE_ADDR to server's REMOTE_ADDR 2 17
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now