 |
| ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

May 26th, 2004, 07:05 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
What am I doing wrong
When I use this select statement within my code I do not get any results: -
strShowDetails = "SELECT * FROM Houses WHERE RentingPrice <= ? AND HouseHold = 'Baffins' AND Smoking = ? AND Furnished = ?";
I am using parameters but I want the HouseHold value to be static. Any ideas??
Adz - The World is not enough
__________________
Adz - Learning The J2EE Ways.
|
|

May 26th, 2004, 07:41 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
What database are you using? I didn't know ? was a reserved term... are you replacing this with something later?
Brian
|
|

May 26th, 2004, 07:48 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Is it possible that your query just doesn't return anything?
|
|

May 26th, 2004, 10:40 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
I guess u used ? instead of parameters!
If u wanna use param for ur command there are 2 ways:
1_ use SP & set the value
2_ use something like @par1, @par2 instead of ? char!!
HTH.
Always:),
Hovik Melkomian.
|
|

May 26th, 2004, 12:03 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Isn't ? the parameter identifier in Access?
|
|

May 26th, 2004, 12:51 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Hello,
In the access documentation that I found, ? is a wildcard character that represents any single alphabetic character... How does ? differentiate between parameters if used in this manner?
Brian
|
|

May 26th, 2004, 12:59 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
So- what your doing wrong is your not understanding how to write a SQL statement.
Hal Levy
Web Developer, PDI Inc.
NOT a Wiley/Wrox Employee
|
|

May 26th, 2004, 03:25 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
For access you can list parameters using ?. I've only seen it used for UPDATE and INSERT statements.
"INSERT INTO table_name" & _
"(column1, column2) " & _
"VALUES (?, ?)"
Dim dbComm As New OleDbCommand(strSQL, objConn)
dbComm.Parameters.Add("column1", OleDbType.Char, 49, "column1")
dbComm.Parameters.Add("column2", OleDbType.Char, 49, "column2")
dbComm.Parameters("column1").Value = txtFirstName.Text
dbComm.Parameters("column2").Value = txtLastName.Text
etc.
With Access the parameters have to be in the exact order of your INSERT statement or whatever statement you use.
|
|

May 26th, 2004, 03:35 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
From within access you can use ?'s... but if your writing the SQL from ASP- I think it needs to conform to standard SQL.
Hal Levy
Web Developer, PDI Inc.
NOT a Wiley/Wrox Employee
|
|

May 26th, 2004, 03:37 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
I use the ? all the time on my small web apps but I am using ASP.NET. I don't think you can use the ? with old ASP.
|
|
 |