|
 |
asp_databases thread: arguments conflict
Message #1 by Jean Halstad <J_Halstad@S...> on Tue, 22 May 2001 16:03:00 +0100
|
|
I know this error message has appeared in a lot of questions, but I am
totally stuck as to how to resolve it.
The error message is:
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
This appears to refer to the strSQL code. The RoomName and Location fields
are both varchar. The roomid field is an autonumber primary key indexed
field in an SQL database.
'Create and Open Rooms recordset
set rsRooms=server.createobject("ADODB.Recordset")
'Identifying the room
strSQLRooms = "select roomid from Rooms where " &_
"RoomName like '"&strRoomName&"' and " &_
"Location like" '"&strLocation"'
rsRooms.open strSQL,cn
response.write rsRooms(roomid)
rsRooms.close
set rsRooms = nothing
Message #2 by "Charles Feduke" <webmaster@r...> on Tue, 22 May 2001 11:35:34 -0400
|
|
Debugging ASP:
Do a Response.Write strSQLRooms before your rsRoom.open line and see if the
SQL string there is valid (i.e. run in it in Query Analyzer or make a new
view in Access and paste it in). You should have a more detailed message
for the error if one exists.
Also:
> strSQLRooms = "select roomid from Rooms where " &_
> "RoomName like '"&strRoomName&"' and " &_
> "Location like" '"&strLocation"'
The final line should have an ending ":
"Location LIKE '" & strLocation & "'"
And although it doesn't seem to apply here, NEVER UNDERESTIMATE THE
NECESSITY OF SPACES. Spaces are good, and although you don't need them in
some places, it is really useful to put them in there because some time it
might just be a lack of spaces causing your problem. -=]
HTH.
? Chuck
> -----Original Message-----
> From: Jean Halstad [mailto:J_Halstad@S...]
> Sent: Tuesday, May 22, 2001 11:03 AM
> To: ASP Databases
> Subject: [asp_databases] arguments conflict
>
>
> I know this error message has appeared in a lot of questions, but I am
> totally stuck as to how to resolve it.
>
> The error message is:
> Arguments are of the wrong type, are out of acceptable range, or are in
> conflict with one another.
> This appears to refer to the strSQL code. The RoomName and Location fields
> are both varchar. The roomid field is an autonumber primary key indexed
> field in an SQL database.
>
> 'Create and Open Rooms recordset
> set rsRooms=server.createobject("ADODB.Recordset")
>
> 'Identifying the room
> strSQLRooms = "select roomid from Rooms where " &_
> "RoomName like '"&strRoomName&"' and " &_
> "Location like" '"&strLocation"'
>
> rsRooms.open strSQL,cn
> response.write rsRooms(roomid)
> rsRooms.close
> set rsRooms = nothing
>
>
>
Message #3 by "Peter Foti (PeterF)" <PeterF@S...> on Tue, 22 May 2001 13:55:56 -0400
|
|
Fix this:
> strSQLRooms =3D "select roomid from Rooms where " &_
> "RoomName like '"&strRoomName&"' and " &_
> "Location like" '"&strLocation"'
to look like this:
strSQLRooms =3D "select roomid from Rooms where " &_
"RoomName like '"&strRoomName&"' and " &_
"Location like '"&strLocation"'
You had an extra double quote in there.
> -----Original Message-----
> From: Jean Halstad [mailto:J_Halstad@S...]
> Sent: Tuesday, May 22, 2001 11:03 AM
> To: ASP Databases
> Subject: [asp_databases] arguments conflict
>
>
> I know this error message has appeared in a lot of questions, but I
am
> totally stuck as to how to resolve it.
>
> The error message is:
> Arguments are of the wrong type, are out of acceptable range,
> or are in
> conflict with one another.
> This appears to refer to the strSQL code. The RoomName and
> Location fields
> are both varchar. The roomid field is an autonumber primary
> key indexed
> field in an SQL database.
>
> 'Create and Open Rooms recordset
> set rsRooms=3Dserver.createobject("ADODB.Recordset")
>
> 'Identifying the room
> strSQLRooms =3D "select roomid from Rooms where " &_
> "RoomName like '"&strRoomName&"' and " &_
> "Location like" '"&strLocation"'
>
> rsRooms.open strSQL,cn
> response.write rsRooms(roomid)
> rsRooms.close
> set rsRooms =3D nothing
Message #4 by "Peter Foti (PeterF)" <PeterF@S...> on Tue, 22 May 2001 14:26:59 -0400
|
|
Ooops... one more thing...
You also need to add another ampersand and end double quote, like this:
strSQLRooms =3D "select roomid from Rooms where " &_
"RoomName like '"&strRoomName&"' and " &_
"Location like '"&strLocation&"'"
> -----Original Message-----
> From: Peter Foti (PeterF) [mailto:PeterF@S...]
> Sent: Tuesday, May 22, 2001 1:56 PM
> To: ASP Databases
> Subject: [asp_databases] RE: arguments conflict
>
>
> Fix this:
> > strSQLRooms =3D "select roomid from Rooms where " &_
> > "RoomName like '"&strRoomName&"' and " &_
> > "Location like" '"&strLocation"'
>
> to look like this:
> strSQLRooms =3D "select roomid from Rooms where " &_
> "RoomName like '"&strRoomName&"' and " &_
> "Location like '"&strLocation"'
>
> You had an extra double quote in there.
>
>
> > -----Original Message-----
> > From: Jean Halstad [mailto:J_Halstad@S...]
> > Sent: Tuesday, May 22, 2001 11:03 AM
> > To: ASP Databases
> > Subject: [asp_databases] arguments conflict
> >
> >
> > I know this error message has appeared in a lot of
> questions, but I am
> > totally stuck as to how to resolve it.
> >
> > The error message is:
> > Arguments are of the wrong type, are out of acceptable range,
> > or are in
> > conflict with one another.
> > This appears to refer to the strSQL code. The RoomName and
> > Location fields
> > are both varchar. The roomid field is an autonumber primary
> > key indexed
> > field in an SQL database.
> >
> > 'Create and Open Rooms recordset
> > set rsRooms=3Dserver.createobject("ADODB.Recordset")
> >
> > 'Identifying the room
> > strSQLRooms =3D "select roomid from Rooms where " &_
> > "RoomName like '"&strRoomName&"' and " &_
> > "Location like" '"&strLocation"'
> >
> > rsRooms.open strSQL,cn
> > response.write rsRooms(roomid)
> > rsRooms.close
> > set rsRooms =3D nothing
> -
Message #5 by Jean Halstad <J_Halstad@S...> on Wed, 23 May 2001 10:45:35 +0100
|
|
Thanks for your help. The statement still isn't correct though.
Response.write produces the following line in the browser. The database is
SQL not Access.
select roomid from Rooms where RoomName like '' and Location like ''
strSQLRooms = "select roomid from Rooms where " &_
"RoomName like ' "&strRoomName&" ' and " &_
"Location like ' "&strLocation&" ' "
response.write strSQLRooms
Message #6 by =?iso-8859-1?Q?H=E5kan_Frennesson?= <hakan@c...> on Wed, 23 May 2001 12:54:07 +0200
|
|
Hi!
Okey, check your formfield/variable names. Also, I think you should use "="
instead of "like" in your SQL statement if you are not permitting wildcards
in your search fields. Try and see if this helps you.
Hakan
-----Original Message-----
From: Jean Halstad [mailto:J_Halstad@S...]
Sent: den 23 maj 2001 11:46
To: ASP Databases
Subject: [asp_databases] arguments conflict
Thanks for your help. The statement still isn't correct though.
Response.write produces the following line in the browser. The database is
SQL not Access.
select roomid from Rooms where RoomName like '' and Location like ''
strSQLRooms = "select roomid from Rooms where " &_
"RoomName like ' "&strRoomName&" ' and " &_
"Location like ' "&strLocation&" ' "
response.write strSQLRooms
Message #7 by "Harish" <harish@a...> on Wed, 23 May 2001 16:11:08 +0530
|
|
Response.write your variable and see weather they are displayed
like
Reponse.write strRoomName
;)
-----Original Message-----
From: Jean Halstad [mailto:J_Halstad@S...]
Sent: Wednesday, May 23, 2001 3:16 PM
To: ASP Databases
Subject: [asp_databases] arguments conflict
Thanks for your help. The statement still isn't correct though.
Response.write produces the following line in the browser. The database is
SQL not Access.
select roomid from Rooms where RoomName like '' and Location like ''
strSQLRooms = "select roomid from Rooms where " &_
"RoomName like ' "&strRoomName&" ' and " &_
"Location like ' "&strLocation&" ' "
response.write strSQLRooms
|
|
 |