p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Please Help me If you can!


Message #1 by "T.L. Jackson" <actionjackson@a...> on Mon, 25 Dec 2000 22:54:48 -0000
I'm having problems with my asp page.  What I'm trying to do is I have a

database created on my server which I'm trying to use as a search

database.  When a user comes to the page, I want them to be able to type

in the last name of the doctor they are looking for and then all the

information for all the doctors with that last name comes up.  Right now,

I'm grabbing data from three different tables.  The problem I'm having is

that I'm getting the following error:



----------------------------

THE ERROR:

----------------------------



DonnaJacksonAdults & Adolescents



Microsoft JET Database Engine error '80040e10'



No value given for one or more required parameters.



/doctorsearch2.asp, line 29



-----------------------------



As you can tell, when I put in the last name of Jackson, it is going to

the database and getting the information for Donna Jackson but then it

gives me that error.  Line 29 in the following code is where you see this

line "objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

tblMembers.PK_UserId", objConn". The code I'm using is as follows:



-----------------------------

THE CODE:

-----------------------------



<%

Dim objConn1

Dim objConn2

Dim LName

set objConn1 = Server.CreateObject("ADODB.Recordset")

set objConn2 = Server.CreateObject("ADODB.Recordset")

LName = Request.Form("LName")

objConn1.Open "Select * from tblMembers Where LName LIKE '" & LName & "'",

objConn

	Do while NOT objConn1.EOF

		Response.write objConn1("FName") & objConn1("LName")

		Response.write objConn1("AgeRange")

		Response.write objConn1("Email")

		Response.write objConn1("HomePageURL")

	objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

tblMembers.PK_UserId", objConn

		Do while NOT objConn2.EOF			

			Response.write objConn2("PK_fk_SpecialtyArea")

			objConn2.MoveNext

		Loop	

	objConn2.close

	objConn1.MoveNext

	Loop

objConn1.Close

Set objConn1=nothing



%>



-----------------------------



	Can Somebody please help me?  I don't know what I'm doing wrong.  So,

please show me the light.  Thank you.



T.L.



--- 

FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

INSIGHTS IN YOUR INBOX!

Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb?s

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #2 by "Dallas Martin" <dmartin@z...> on Mon, 25 Dec 2000 19:02:29 -0500
You need to use the tblMembers.K_UserID in your second query. Either store

it to a variable

as in



PK_ID = objConn1("PK_UserID")



Your code:

objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID =" & PK_ID



or directly in the second query

objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID =" &

objConn1("PK_UserID")



BETTER YET, write ONE query to select everything. This reduces trips to the

servers and save resources



DON'T USE "SELECT *" in your queries. It is better to specifically select

only the fields you need.

Again this increases performance and reduces overhead.



HERE IS YOUR QUERY REWRITTEN:



"SELECT mem.Fname, mem.Lname, memAgeRange, mem.Email, mem.HomePageURL,

spec.PK_fk_SpecialtyArea

FROM tblMembers AS mem

INNER JOIN tblSpecialties AS spec

ON mem.PK_UserId = spec.PK_fk_UserID

AND mem.Lname LIKE '" & rtrim(lname) & "%'"



hth,

DM











----- Original Message -----

From: "T.L. Jackson" <actionjackson@a...>

To: "ASP Databases" <asp_databases@p...>

Sent: Monday, December 25, 2000 5:54 PM

Subject: [asp_databases] Please Help me If you can!





> I'm having problems with my asp page.  What I'm trying to do is I have a

> database created on my server which I'm trying to use as a search

> database.  When a user comes to the page, I want them to be able to type

> in the last name of the doctor they are looking for and then all the

> information for all the doctors with that last name comes up.  Right now,

> I'm grabbing data from three different tables.  The problem I'm having is

> that I'm getting the following error:

>

> ----------------------------

> THE ERROR:

> ----------------------------

>

> DonnaJacksonAdults & Adolescents

>

> Microsoft JET Database Engine error '80040e10'

>

> No value given for one or more required parameters.

>

> /doctorsearch2.asp, line 29

>

> -----------------------------

>

> As you can tell, when I put in the last name of Jackson, it is going to

> the database and getting the information for Donna Jackson but then it

> gives me that error.  Line 29 in the following code is where you see this

> line "objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

> tblMembers.PK_UserId", objConn". The code I'm using is as follows:

>

> -----------------------------

> THE CODE:

> -----------------------------

>

> <%

> Dim objConn1

> Dim objConn2

> Dim LName

> set objConn1 = Server.CreateObject("ADODB.Recordset")

> set objConn2 = Server.CreateObject("ADODB.Recordset")

> LName = Request.Form("LName")

> objConn1.Open "Select * from tblMembers Where LName LIKE '" & LName & "'",

> objConn

> Do while NOT objConn1.EOF

> Response.write objConn1("FName") & objConn1("LName")

> Response.write objConn1("AgeRange")

> Response.write objConn1("Email")

> Response.write objConn1("HomePageURL")

> objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

> tblMembers.PK_UserId", objConn

> Do while NOT objConn2.EOF

> Response.write objConn2("PK_fk_SpecialtyArea")

> objConn2.MoveNext

> Loop

> objConn2.close

> objConn1.MoveNext

> Loop

> objConn1.Close

> Set objConn1=nothing

>

> %>

>

> -----------------------------

>

> Can Somebody please help me?  I don't know what I'm doing wrong.  So,

> please show me the light.  Thank you.

>

> T.L.

>



--- 

FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

INSIGHTS IN YOUR INBOX!

Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb?s

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #3 by "bizindia" <bizindia@h...> on Tue, 26 Dec 2000 08:57:53 +0530
This is a multi-part message in MIME format.



------=_NextPart_000_0011_01C06F19.EEB615F0

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



Hi,

can you paste the sql querry that you are Executing. It seems you are 

missing to pass certain parameters.

Thanks



----------------------------------------------------------------------

Find Your Dream Job right here at Jobsure...

----------------------------------------------------------------------



http://www.JobSure.com

JobSure@J...

-----------------------------------

  ----- Original Message -----

  From: T.L. Jackson

  To: ASP Databases

  Sent: Tuesday, December 26, 2000 4:24 AM

  Subject: [asp_databases] Please Help me If you can!





  I'm having problems with my asp page.  What I'm trying to do is I have 

a

  database created on my server which I'm trying to use as a search

  database.  When a user comes to the page, I want them to be able to 

type

  in the last name of the doctor they are looking for and then all the

  information for all the doctors with that last name comes up.  Right 

now,

  I'm grabbing data from three different tables.  The problem I'm having 

is

  that I'm getting the following error:



  ----------------------------

  THE ERROR:

  ----------------------------



  DonnaJacksonAdults & Adolescents



  Microsoft JET Database Engine error '80040e10'



  No value given for one or more required parameters.



  /doctorsearch2.asp, line 29



  -----------------------------



  As you can tell, when I put in the last name of Jackson, it is going 

to

  the database and getting the information for Donna Jackson but then it

  gives me that error.  Line 29 in the following code is where you see 

this

  line "objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

=3D

  tblMembers.PK_UserId", objConn". The code I'm using is as follows:



  -----------------------------

  THE CODE:

  -----------------------------



  <%

  Dim objConn1

  Dim objConn2

  Dim LName

  set objConn1 =3D Server.CreateObject("ADODB.Recordset")

  set objConn2 =3D Server.CreateObject("ADODB.Recordset")

  LName =3D Request.Form("LName")

  objConn1.Open "Select * from tblMembers Where LName LIKE '" & LName & 

"'",

  objConn

  Do while NOT objConn1.EOF

  Response.write objConn1("FName") & objConn1("LName")

  Response.write objConn1("AgeRange")

  Response.write objConn1("Email")

  Response.write objConn1("HomePageURL")

  objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID =3D

  tblMembers.PK_UserId", objConn

  Do while NOT objConn2.EOF

  Response.write objConn2("PK_fk_SpecialtyArea")

  objConn2.MoveNext

  Loop

  objConn2.close

  objConn1.MoveNext

  Loop

  objConn1.Close

  Set objConn1=3Dnothing



  %>



  -----------------------------



  Can Somebody please help me?  I don't know what I'm doing wrong.  So,

  please show me the light.  Thank you.



  T.L.



  ---

  FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

  INSIGHTS IN YOUR INBOX!

  Get the latest and best C++, Visual C++, Java, Visual Basic, and XML 

tips, tools, and

  developments from the experts.  Sign up for one or more of EarthWeb?s

  FREE IT newsletters at http://www.earthweb.com today! 




leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com









---

FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

IN YOUR INBOX!

Get the latest and best HTML, XML, and JavaScript tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb's

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com








Message #4 by "Tahir" <taijaz@t...> on Tue, 26 Dec 2000 08:23:35 -0000
Try this :



        objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID ='" &

objConn1("PK_UserId") &"';", objConn



----------

TahirAijaz





> I'm having problems with my asp page.  What I'm trying to do is I have a

> database created on my server which I'm trying to use as a search

> database.  When a user comes to the page, I want them to be able to type

> in the last name of the doctor they are looking for and then all the

> information for all the doctors with that last name comes up.  Right now,

> I'm grabbing data from three different tables.  The problem I'm having is

> that I'm getting the following error:

> 

> ----------------------------

> THE ERROR:

> ----------------------------

> 

> DonnaJacksonAdults & Adolescents

> 

> Microsoft JET Database Engine error '80040e10'

> 

> No value given for one or more required parameters.

> 

> /doctorsearch2.asp, line 29

> 

> -----------------------------

> 

> As you can tell, when I put in the last name of Jackson, it is going to

> the database and getting the information for Donna Jackson but then it

> gives me that error.  Line 29 in the following code is where you see this

> line "objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

> tblMembers.PK_UserId", objConn". The code I'm using is as follows:

> 

> -----------------------------

> THE CODE:

> -----------------------------

> 

> <%

> Dim objConn1

> Dim objConn2

> Dim LName

> set objConn1 = Server.CreateObject("ADODB.Recordset")

> set objConn2 = Server.CreateObject("ADODB.Recordset")

> LName = Request.Form("LName")

> objConn1.Open "Select * from tblMembers Where LName LIKE '" & LName & "'",

> objConn

>    Do while NOT objConn1.EOF

>            Response.write objConn1("FName") & objConn1("LName")

>            Response.write objConn1("AgeRange")

>            Response.write objConn1("Email")

>            Response.write objConn1("HomePageURL")

>    objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

> tblMembers.PK_UserId", objConn

>            Do while NOT objConn2.EOF                       

>                    Response.write objConn2("PK_fk_SpecialtyArea")

>                    objConn2.MoveNext

>            Loop    

>    objConn2.close

>    objConn1.MoveNext

>    Loop

> objConn1.Close

> Set objConn1=nothing

> 

> %>

> 

> -----------------------------

> 

>    Can Somebody please help me?  I don't know what I'm doing wrong.  So,

> please show me the light.  Thank you.

> 

> T.L.

> 



--- 

NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS?  Is FREE okay?

Visit EarthWeb for the latest in IT Management, Software Development, 

Web Development, Networking & Communications, and Hardware & Systems.  

Click on http://www.earthweb.com for FREE articles, tutorials,

and discussions from the experts.

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #5 by "Pappas Nikos" <pappas@c...> on Tue, 26 Dec 2000 10:28:01 -0800
Hi

I see there's no references to the other variables of your search

Like you did in  the beginning of your code for Lname

add



dim AgeRange

dim Email

dim HomePageURL



that's where the no value given comes from

for the rest of the code I don't know experiment with it but make sure

you pass all the parameters from your request form to your asp successfully

Take care

Nikos





-----Original Message-----

From: T.L. Jackson [mailto:actionjackson@a...]

Sent: Monday, December 25, 2000 2:55 PM

To: ASP Databases

Subject: [asp_databases] Please Help me If you can!





I'm having problems with my asp page.  What I'm trying to do is I have a

database created on my server which I'm trying to use as a search

database.  When a user comes to the page, I want them to be able to type

in the last name of the doctor they are looking for and then all the

information for all the doctors with that last name comes up.  Right now,

I'm grabbing data from three different tables.  The problem I'm having is

that I'm getting the following error:



----------------------------

THE ERROR:

----------------------------



DonnaJacksonAdults & Adolescents



Microsoft JET Database Engine error '80040e10'



No value given for one or more required parameters.



/doctorsearch2.asp, line 29



-----------------------------



As you can tell, when I put in the last name of Jackson, it is going to

the database and getting the information for Donna Jackson but then it

gives me that error.  Line 29 in the following code is where you see this

line "objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

tblMembers.PK_UserId", objConn". The code I'm using is as follows:



-----------------------------

THE CODE:

-----------------------------



<%

Dim objConn1

Dim objConn2

Dim LName

set objConn1 = Server.CreateObject("ADODB.Recordset")

set objConn2 = Server.CreateObject("ADODB.Recordset")

LName = Request.Form("LName")

objConn1.Open "Select * from tblMembers Where LName LIKE '" & LName & "'",

objConn

        Do while NOT objConn1.EOF

                Response.write objConn1("FName") & objConn1("LName")

                Response.write objConn1("AgeRange")

                Response.write objConn1("Email")

                Response.write objConn1("HomePageURL")

        objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

tblMembers.PK_UserId", objConn

                Do while NOT objConn2.EOF

                        Response.write objConn2("PK_fk_SpecialtyArea")

                        objConn2.MoveNext

                Loop

        objConn2.close

        objConn1.MoveNext

        Loop

objConn1.Close

Set objConn1=nothing



%>



-----------------------------



        Can Somebody please help me?  I don't know what I'm doing wrong.  So,

please show me the light.  Thank you.



T.L.





--- 

FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

INSIGHTS IN YOUR INBOX!

Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and 

developments from the experts.  Sign up for one or more of EarthWeb?s

FREE IT newsletters at http://www.earthweb.com today!  

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com

Message #6 by Brad Bansner <brad@b...> on Tue, 26 Dec 2000 11:48:24 -0500
> objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

> tblMembers.PK_UserId", objConn



I believe the problem is that you are asking for everything from the table

"tblSpecialties", but you are comparing PK_fk_UserID (which I assume is a

field in tblSpecialties), and equating it to tblMembers.PK_UserID (which is

a different table).



In order to compare fields in two separate tables, you have to make the FROM

clause combine the two tables, as in...



      ... from tblSpecialties, tblMembers where ...



You have to make sure everything "matches up" in those two tables. By using

a common index field (I'm guessing you already did this when you said

PK_fk_UserID = tbl_Members.PK_UserID.



Hope this helps!



-Brad







> From: "T.L. Jackson" <actionjackson@a...>

> Reply-To: "ASP Databases" <asp_databases@p...>

> Date: Mon, 25 Dec 2000 22:54:48 -0000

> To: "ASP Databases" <asp_databases@p...>

> Subject: [asp_databases] Please Help me If you can!

> 

> I'm having problems with my asp page.  What I'm trying to do is I have a

> database created on my server which I'm trying to use as a search

> database.  When a user comes to the page, I want them to be able to type

> in the last name of the doctor they are looking for and then all the

> information for all the doctors with that last name comes up.  Right now,

> I'm grabbing data from three different tables.  The problem I'm having is

> that I'm getting the following error:

> 

> ----------------------------

> THE ERROR:

> ----------------------------

> 

> DonnaJacksonAdults & Adolescents

> 

> Microsoft JET Database Engine error '80040e10'

> 

> No value given for one or more required parameters.

> 

> /doctorsearch2.asp, line 29

> 

> -----------------------------

> 

> As you can tell, when I put in the last name of Jackson, it is going to

> the database and getting the information for Donna Jackson but then it

> gives me that error.  Line 29 in the following code is where you see this

> line "objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

> tblMembers.PK_UserId", objConn". The code I'm using is as follows:

> 

> -----------------------------

> THE CODE:

> -----------------------------

> 

> <%

> Dim objConn1

> Dim objConn2

> Dim LName

> set objConn1 = Server.CreateObject("ADODB.Recordset")

> set objConn2 = Server.CreateObject("ADODB.Recordset")

> LName = Request.Form("LName")

> objConn1.Open "Select * from tblMembers Where LName LIKE '" & LName & "'",

> objConn

> Do while NOT objConn1.EOF

> Response.write objConn1("FName") & objConn1("LName")

> Response.write objConn1("AgeRange")

> Response.write objConn1("Email")

> Response.write objConn1("HomePageURL")

> objConn2.Open "Select * from tblSpecialties Where PK_fk_UserID 

> tblMembers.PK_UserId", objConn

> Do while NOT objConn2.EOF

> Response.write objConn2("PK_fk_SpecialtyArea")

> objConn2.MoveNext

> Loop    

> objConn2.close

> objConn1.MoveNext

> Loop

> objConn1.Close

> Set objConn1=nothing

> 

> %>

> 

> -----------------------------

> 

> Can Somebody please help me?  I don't know what I'm doing wrong.  So,

> please show me the light.  Thank you.

> 

> T.L.





--- 

NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS?  Is FREE okay?

Visit EarthWeb for the latest in IT Management, Software Development, 

Web Development, Networking & Communications, and Hardware & Systems.  

Click on http://www.earthweb.com for FREE articles, tutorials,

and discussions from the experts.

---

You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')

To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com


  Return to Index