473,395 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

SQL error "Arguments are of the wrong type ..."

Hi

I have a web page which receives information from a form (using
request.form) and also attempts to look at an Access query to read in
recoeds to a variable named rsGroup.

When I have the following line commented, so it does not activate, I
can successfully print all of the response.write's below:

rsGroup.Open strSQL, adoCon

response.write(strSQL)
response.write("<P>")
response.write(GroupSend)
response.write("<P>")
response.write(request.form("GroupName"))
response.write("<P>")
response.write(" " & request.form("Subject"))
response.write("<P>")
response.write(" " & request.form("Content"))

response.write(strSQL) prints as:
SELECT qrySendemail*GroupName FROM qrySendemail WHERE GroupName =
'FOOTBALL'
and works fine if I use it directly in an access query

However when I uncomment

rsGroup.Open strSQL, adoCon

I get the following error message

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

You will see I have several alternative SQL's (currently
commented)which I have tried, all work OK when rsGroup.Open strSQL,
adoCon is commented.

I have several other pages using similar ado connections and generally
similar code, which work OK.

Any advice would be appreciated

Note - I do realise I am querying an access query not a table; I will
not be updating or deleting records in the query.

Thanks ColinK

Code:

<%@ Language=VBScript %>

<%
'Dimension variables
Dim objDC 'Holds the Database Connection Object
Dim strSQL 'Holds the SQL query to query the database
Dim rsGroup 'Holds the details of group members
Dim GroupSend 'holds the group name to send to

'insert the Group name to send to into the variable GroupSend
GroupSend = (Request.Form("GroupName"))

'Create an ADO connection object on the server using the ADO Database
connection object
Set objDC = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a ****
DSN-less connection ****
objDC.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("../databases/GC1.mdb")

'Create an ADO recordset object
Set rsGroup = Server.CreateObject("ADODB.Recordset")

' request record for requested Groupid

'NOTE first 2 sql's are currently commented
'strSQL = "SELECT * FROM qrySendemail WHERE GroupName = '" &
Request.Form("GroupName") &"' "
'strSQL = "SELECT * FROM qrySendemail WHERE GroupName = 'FOOTBALL' "
strSQL = "SELECT qrySendemail*GroupName FROM qrySendemail WHERE
GroupName = 'FOOTBALL' "
'Set the cursor type we are using so we can navigate through the
recordset
rsGroup.CursorType = 2

'Open the recordset with the SQL query
'rsGroup.Open strSQL, adoCon
'rsGroup.Close

response.write(strSQL)
response.write("<P>")
response.write(GroupSend)
response.write("<P>")
response.write(request.form("GroupName"))
response.write("<P>")
response.write(" " & request.form("Subject"))
response.write("<P>")
response.write(" " & request.form("Content"))
%>

Nov 13 '05 #1
1 3566
ia****@gmail.com wrote:
However when I uncomment

rsGroup.Open strSQL, adoCon

I get the following error message

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

You will see I have several alternative SQL's (currently
commented)which I have tried, all work OK when rsGroup.Open strSQL,
adoCon is commented.

I have several other pages using similar ado connections and generally
similar code, which work OK.


The first thing I'd look at would be the reference to ADO or the
inclusion of adovbs.inc but not both as they tend to conflict one
another sometimes.

Then look at the type of recordset you are opening as you don't specify
one in that line of code.

--
[OO=00=OO]
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: toufik toufik | last post by:
I'm using the errorHandler function (http://www.zend.com/zend/spotlight/error.php) to manage error handling in my code, the problem is that in all the tests that I did the error type is always...
2
by: News Central | last post by:
To all! I use the DateDiff function using VB6 and get this error 'Wrong number of argument or invalid property assignment' ... have anyone seen this problem? thanks ....
2
by: Iona | last post by:
Does anyone know this type of error means? Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Could not use ''(unknown)''; file already in use. /asp/PPLMain/memberpage.asp, line...
1
by: Jack | last post by:
Hi, I am trying to add a new record to a main page. This page is the processing page to a form. However, I am getting the following error message: Error Type: ADODB.Recordset (0x800A0BB9)...
8
by: eminemence | last post by:
Hi, I have been trying to get STLPort work for Symbian. I am using CodeWarrior compiler and it spews this errors namely *************************************************************************...
1
by: Pradeep83 | last post by:
Hi All, Good Morning Here I am jotdowning my problem I am compiling a .c file in Free BSD 6.0 and exceuting there itself. and i have taken that...
17
imrosie
by: imrosie | last post by:
I've tried this string to Sum up payments, moving brackets and paren's different ways, I still get error 'type mismatch'....not sure why. Can anyone point me in the right direction?? thanks ...
4
by: ravi | last post by:
Hi all, I written and compiled a c++ program using g++ no errors or warning are reported. But when I run it , reporting an error : ERROR: Wrong magic number. What is the reason for this...
2
by: colesslow | last post by:
i have these asp files to edit a record in my sql server..but it can't be done. the error is Error Type: ADODB.Recordset (0x800A0E7D) The connection cannot be used to perform this operation. It...
1
by: shivasusan | last post by:
Hi Friends! Please Help me! How i can solve this error? Please explain me, what is the error and how to solve? Error Type: ADODB.Recordset (0x800A0E7D) The connection cannot be used to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.