|
 |
asp_databases thread: Column Name with Spaces
Message #1 by "Reetu Mathur" <reetu_m@h...> on Fri, 20 Dec 2002 16:27:04
|
|
Hello,
I have an access database in which one of the column names is
"WORKSHOP TYPE"(i.e. this column name contains a space).
I have no problem running the SQL query to retrieve matching records.
However when I try to print them using
Response.Write "<b>WORKSHOP TYPE</b>" & objRS("WORKSHOP TYPE") & "<BR>"
I get a error like this: -
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested
name or ordinal.
/list.asp, line 33
I do realize the problem is the colum name with the space. But this
database was designed by someone else and I cannot make changes to the
database because there are other pages depending on it.
Are there any suggestions for me ?
Thanks a lot for your help.
Message #2 by Colin.Montgomery@C... on Fri, 20 Dec 2002 16:30:44 -0000
|
|
not sure why that's not working, but you could always Alias the column in
your SQL, like this:
SELECT [Workshop Type] As WorkshopType
FROM tblMyTable
Then you can access the field in the rs by:
objRs("WorkshopType")
Perhaps all you need to do is stick some brackets around the WORKSHOP TYPE?
HTH,
Col
-----Original Message-----
From: Reetu Mathur [mailto:reetu_m@h...]
Sent: 20 December 2002 16:27
To: ASP Databases
Subject: [asp_databases] Column Name with Spaces
Hello,
I have an access database in which one of the column names is
"WORKSHOP TYPE"(i.e. this column name contains a space).
I have no problem running the SQL query to retrieve matching records.
However when I try to print them using
Response.Write "<b>WORKSHOP TYPE</b>" & objRS("WORKSHOP TYPE") & "<BR>"
I get a error like this: -
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested
name or ordinal.
/list.asp, line 33
I do realize the problem is the colum name with the space. But this
database was designed by someone else and I cannot make changes to the
database because there are other pages depending on it.
Are there any suggestions for me ?
Thanks a lot for your help.
*******
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the
intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are
not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.
For further information about Clifford Chance please see our website at http://www.cliffordchance.com or refer to any Clifford
Chance office.
Message #3 by "Reetu Mathur" <reetu_m@h...> on Fri, 20 Dec 2002 17:22:28
|
|
Hello Colin,
Thanks for you response. I do however have a follow up question.
Here is my code
...
objCommand.CommandText = "SELECT DATE ,CITY,[WORKSHOP TYPE] as
WorkShopType FROM Schedule "
objCommand.CommandType = adCmdText
Set objRS = objCommand.Execute
...
While Not objRS.EOF
Response.Write "DATE:" & objRS("DATE") & "CITY" & objRS("CITY") &
"<b>WORKSHOP TYPE</b>" & objRS("WorkShopType")
Response.Write "<HR>"
objRS.MoveNext
Wend
...
This code now produces the following error: -
Microsoft JET Database Engine error '80040e10'
No value given for one or more required parameters.
/list.asp, line 25
What do you think is wrong ?
Thanks for your help,
Reetu
---
> not sure why that's not working, but you could always Alias the column
in
your SQL, like this:
SELECT [Workshop Type] As WorkshopType
FROM tblMyTable
Then you can access the field in the rs by:
objRs("WorkshopType")
Perhaps all you need to do is stick some brackets around the WORKSHOP
TYPE?
HTH,
Col
-----Original Message-----
From: Reetu Mathur [mailto:reetu_m@h...]
Sent: 20 December 2002 16:27
To: ASP Databases
Subject: [asp_databases] Column Name with Spaces
Hello,
I have an access database in which one of the column names is
"WORKSHOP TYPE"(i.e. this column name contains a space).
I have no problem running the SQL query to retrieve matching records.
However when I try to print them using
Response.Write "<b>WORKSHOP TYPE</b>" & objRS("WORKSHOP TYPE") & "<BR>"
I get a error like this: -
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested
name or ordinal.
/list.asp, line 33
I do realize the problem is the colum name with the space. But this
database was designed by someone else and I cannot make changes to the
database because there are other pages depending on it.
Are there any suggestions for me ?
Thanks a lot for your help.
*******
This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure. If you are not the intended
recipient, please telephone or email the sender and delete this message
and any attachment from your system. If you are not the intended
recipient you must not copy this message or attachment or disclose the
contents to any other person.
For further information about Clifford Chance please see our website at
http://www.cliffordchance.com or refer to any Clifford Chance office.
Message #4 by "Reetu Mathur" <reetu_m@h...> on Fri, 20 Dec 2002 17:49:48
|
|
> Hello,
> I have an access database in which one of the column names is
"> WORKSHOP TYPE"(i.e. this column name contains a space).
> I have no problem running the SQL query to retrieve matching records.
H> owever when I try to print them using
> Response.Write "<b>WORKSHOP TYPE</b>" & objRS("WORKSHOP TYPE") & "<BR>"
> I get a error like this: -
> ADODB.Recordset error '800a0cc1'
I> tem cannot be found in the collection corresponding to the requested
n> ame or ordinal.
/> list.asp, line 33
> I do realize the problem is the colum name with the space. But this
d> atabase was designed by someone else and I cannot make changes to the
d> atabase because there are other pages depending on it.
> Are there any suggestions for me ?
> Thanks a lot for your help.
Message #5 by "Paulo Fernandes" <paulofernandes@c...> on Fri, 20 Dec 2002 18:38:34 -0000
|
|
Reetu,
I guess it isn't the most appropriate thing to do, but how about
creating a
query on the database, changing the query column name to something
without
spaces and referencing this query on your asp page?
It'll give you time to find a more fancy way to do it...!
Cheers
Paulo Fernandes
Consernet, Lda.
www.consernet.com
Telefone: +xxx xxx xxx xxx
Telem=F3vel: +xxx xxx xxx xxx
Fax: +xxx xxx xxx xxx
-------------------------------------------------------------------------
--
Este e-mail =E9 confidencial. Se voc=EA n=E3o =E9 o destinat=E1rio
pretendido deste
e-mail,n=E3o dever=E1 usar qualquer informa=E7=E3o nele contida. Se
recebeu este
e-mail por erro, envie-o para administrador@c...,
apagando-o de seguida.
This email is confidential. If you are not the intended recipient, you
must
not disclose or use the information contained in it. If you have
received
this mail in error, please forward it to administrador@c... and
delete the document.
-----Original Message-----
From: Reetu Mathur [mailto:reetu_m@h...]
Sent: sexta-feira, 20 de Dezembro de 2002 16:27
To: ASP Databases
Subject: [asp_databases] Column Name with Spaces
Hello,
I have an access database in which one of the column names is
"WORKSHOP TYPE"(i.e. this column name contains a space).
I have no problem running the SQL query to retrieve matching records.
However when I try to print them using
Response.Write "<b>WORKSHOP TYPE</b>" & objRS("WORKSHOP TYPE") & "<BR>"
I get a error like this: -
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested
name or ordinal.
/list.asp, line 33
I do realize the problem is the colum name with the space. But this
database was designed by someone else and I cannot make changes to the
database because there are other pages depending on it.
Are there any suggestions for me ?
Thanks a lot for your help.
Message #6 by "Serene Groups" <info@s...> on Sat, 21 Dec 2002 11:08:59 +0530
|
|
Check the records are available or not? I suspect there .EOF must required
(f records are not available). Name doesn't make different as far as its
same constraint.
-----Original Message-----
From: Reetu Mathur [mailto:reetu_m@h...]
Sent: Friday, December 20, 2002 4:27 PM
To: ASP Databases
Subject: [asp_databases] Column Name with Spaces
Hello,
I have an access database in which one of the column names is
"WORKSHOP TYPE"(i.e. this column name contains a space).
I have no problem running the SQL query to retrieve matching records.
However when I try to print them using
Response.Write "<b>WORKSHOP TYPE</b>" & objRS("WORKSHOP TYPE") & "<BR>"
I get a error like this: -
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested
name or ordinal.
/list.asp, line 33
I do realize the problem is the colum name with the space. But this
database was designed by someone else and I cannot make changes to the
database because there are other pages depending on it.
Are there any suggestions for me ?
Thanks a lot for your help.
Message #7 by <hijazia@c...> on Sun, 22 Dec 2002 0:33:22 +0300
|
|
Dear Reetu
try using the number of the column
i.e if WORKSHOP TYPE is the second column in the table's definition then you can write:
response.write objRS(1)
here we start with the 0 as the first column in a table
Best Regards
>
> From: "Reetu Mathur" <reetu_m@h...>
> Date: 2002/12/20 Fri PM 06:49:48 GMT+03:00
> To: "ASP Databases" <asp_databases@p...>
> Subject: [asp_databases] Re: Column Name with Spaces
>
> > Hello,
>
> > I have an access database in which one of the column names is
> "> WORKSHOP TYPE"(i.e. this column name contains a space).
>
> > I have no problem running the SQL query to retrieve matching records.
> H> owever when I try to print them using
>
> > Response.Write "<b>WORKSHOP TYPE</b>" & objRS("WORKSHOP TYPE") & "<BR>"
>
> > I get a error like this: -
>
> > ADODB.Recordset error '800a0cc1'
> I> tem cannot be found in the collection corresponding to the requested
> n> ame or ordinal.
> /> list.asp, line 33
>
> > I do realize the problem is the colum name with the space. But this
> d> atabase was designed by someone else and I cannot make changes to the
> d> atabase because there are other pages depending on it.
>
> > Are there any suggestions for me ?
>
> > Thanks a lot for your help.
>
AliHijazi
www.alihijazi.150m.com
|
|
 |