ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old February 7th, 2000, 06:31 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,578 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Help..can't solve this problem

<i><b>Originally posted by : kaarthik (kaarthik@singnet.com.sg)</b></i><br />Hi<br />I have this error which I can't solve. Could anybody please help me. ok here it goes<br />I have two tables 1) states 2)angel<br />the states table has all the states of the world<br />the angel table contains information pertaining to the states table. the asp page which I have is supposed to fill a pulldown box with the states table. Then with the requested string I have to search the angel table which contains the state..then its supposed to show the angel table records which contains the state. But I get an error like this<br />Microsoft OLE DB Provider for ODBC Drivers error '80040e10' <br /><br />[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. <br /><br />/dbshow.asp, line 24 <br /><br />Please help<br />the code is shown here <br /><br /><br /><%<br />Dim objDC, objRS<br /><br />' Create and establish data connection<br />Set objDC = Server.CreateObject("ADODB.Connection")<br /><br /><br />'Use this line to use Access<br />objDC.Open "DSN=new"<br /><br />'Our SQL Server code - use above line to use sample on your server<br />'objDC.Open Application("SQLConnString"), Application("SQLUsername"), Application("SQLPassword")<br /><br /><br />' Create recordset and retrieve values using the open connection<br />Set objRS = Server.CreateObject("ADODB.Recordset")<br />' Opening record set with a forward-only cursor (the 0) and in read-only mode (the 1)<br /><br />' If a request for a specific id comes in, then do it o/w just show pulldown<br />If Len(Request.QueryString("State")) <> 0 Then<br /> ' request record for requested state<br /> objRS.Open "SELECT * FROM Angel WHERE Departure=" & Request.QueryString("State"), objDC, 0, 1<br /> ' Show selected record<br /> If Not objRS.EOF Then<br /> objRS.MoveFirst<br /> %><br /> <TABLE BORDER=2><br /> <TR><br /> <TD><B>Departure</B></TD><br /> <TD><B>Vessel</B></TD><br /> <TD><B>Voyage No.</B></TD><br /> <TD><B>Operator</B></TD><br /> <TD><B>Arrival</B></TD><br /> </TR><br /> <TR><br /> <TD ALIGN="center"><%= objRS.Fields("Departure") %></TD><br /> <TD ALIGN="center"><%= objRS.Fields("Vessel") %></TD><br /> <TD ALIGN="center"><%= objRS.Fields("Voyage") %></TD><br /> <TD ALIGN="center"><%= objRS.Fields("Operator") %></TD><br /> <TD ALIGN="center"><%= objRS.Fields("Arrival") %></TD><br /> </TR><br /> </TABLE><br /> <%<br /> End If<br /> objRS.Close<br />End If<br /><br />objRS.Open "SELECT * FROM States", objDC, 0, 1<br />' Loop through recordset and display results<br />If Not objRS.EOF Then<br /> objRS.MoveFirst<br /> ' the form below calls this file only this time with an id in the QueryString<br /> %><br /> <FORM ACTION="./dbshow.asp" METHOD="get"><br /> <SELECT NAME="State"><br /> <OPTION></OPTION><br /> <%<br /> ' Continue until we get to the end of the recordset.<br /> Do While Not objRS.EOF<br /> ' For each record we create a option tag and set it's value to the employee id<br /> ' The text we set to the employees first name combined with a space and then their last name<br /> %><br /> <OPTION VALUE="<%=objRS.Fields("State") %>"><%=objRS.Fields("State")%></OPTION><br /> <%<br /> ' Get next record<br /> objRS.MoveNext<br /> Loop<br /> %><br /> </SELECT><br /> <INPUT type="submit" value="Submit"><br /> </FORM><br /> <%<br />End If<br /><br />' Close Data Access Objects and free DB variables<br />objRS.Close<br />Set objRS = Nothing<br />objDC.Close<br />Set objDC = Nothing<br />%><br />

Reply With Quote
  #2  
Old February 8th, 2000, 06:33 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,578 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Eric Isaacs (eisaacs@costco.com)</b></i><br />I can't see your db, but I imagine that the state data is text, not numeric. If this is the case, change your SQL to the following...<br /><br />objRS.Open "SELECT * FROM Angel WHERE Departure=""" & Trim(Request.QueryString("State")) & """", objDC, 0, 1<br /><br />This will insert double quotes around the state value. If it is numeric data, then the quotes are not required.<br /><br />Eric Isaaacs<br /><br />------------<br />kaarthik at 2/7/00 4:31:24 AM<br /><br />Hi<br />I have this error which I can't solve. Could anybody please help me. ok here it goes<br />I have two tables 1) states 2)angel<br />the states table has all the states of the world<br />the angel table contains information pertaining to the states table. the asp page which I have is supposed to fill a pulldown box with the states table. Then with the requested string I have to search the angel table which contains the state..then its supposed to show the angel table records which contains the state. But I get an error like this<br />Microsoft OLE DB Provider for ODBC Drivers error '80040e10' <br /><br />[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. <br /><br />/dbshow.asp, line 24 <br /><br />Please help<br />the code is shown here <br /><br /><br /><%<br />Dim objDC, objRS<br /><br />' Create and establish data connection<br />Set objDC = Server.CreateObject("ADODB.Connection")<br /><br /><br />'Use this line to use Access<br />objDC.Open "DSN=new"<br /><br />'Our SQL Server code - use above line to use sample on your server<br />'objDC.Open Application("SQLConnString"), Application("SQLUsername"), Application("SQLPassword")<br /><br /><br />' Create recordset and retrieve values using the open connection<br />Set objRS = Server.CreateObject("ADODB.Recordset")<br />' Opening record set with a forward-only cursor (the 0) and in read-only mode (the 1)<br /><br />' If a request for a specific id comes in, then do it o/w just show pulldown<br />If Len(Request.QueryString("State")) <> 0 Then<br /> ' request record for requested state<br /> objRS.Open "SELECT * FROM Angel WHERE Departure=" & Request.QueryString("State"), objDC, 0, 1<br /> ' Show selected record<br /> If Not objRS.EOF Then<br /> objRS.MoveFirst<br /> %><br /> <TABLE BORDER=2><br /> <TR><br /> <TD><B>Departure</B></TD><br /> <TD><B>Vessel</B></TD><br /> <TD><B>Voyage No.</B></TD><br /> <TD><B>Operator</B></TD><br /> <TD><B>Arrival</B></TD><br /> </TR><br /> <TR><br /> <TD ALIGN="center"><%= objRS.Fields("Departure") %></TD><br /> <TD ALIGN="center"><%= objRS.Fields("Vessel") %></TD><br /> <TD ALIGN="center"><%= objRS.Fields("Voyage") %></TD><br /> <TD ALIGN="center"><%= objRS.Fields("Operator") %></TD><br /> <TD ALIGN="center"><%= objRS.Fields("Arrival") %></TD><br /> </TR><br /> </TABLE><br /> <%<br /> End If<br /> objRS.Close<br />End If<br /><br />objRS.Open "SELECT * FROM States", objDC, 0, 1<br />' Loop through recordset and display results<br />If Not objRS.EOF Then<br /> objRS.MoveFirst<br /> ' the form below calls this file only this time with an id in the QueryString<br /> %><br /> <FORM ACTION="./dbshow.asp" METHOD="get"><br /> <SELECT NAME="State"><br /> <OPTION></OPTION><br /> <%<br /> ' Continue until we get to the end of the recordset.<br /> Do While Not objRS.EOF<br /> ' For each record we create a option tag and set it's value to the employee id<br /> ' The text we set to the employees first name combined with a space and then their last name<br /> %><br /> <OPTION VALUE="<%=objRS.Fields("State") %>"><%=objRS.Fields("State")%></OPTION><br /> <%<br /> ' Get next record<br /> objRS.MoveNext<br /> Loop<br /> %><br /> </SELECT><br /> <INPUT type="submit" value="Submit"><br /> </FORM><br /> <%<br />End If<br /><br />' Close Data Access Objects and free DB variables<br />objRS.Close<br />Set objRS = Nothing<br />objDC.Close<br />Set objDC = Nothing<br />%><br />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Help..can't solve this problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway