p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: ASP to Access database query not return data.


Message #1 by "chris kibbe" <christopher_kibbe@c...> on Tue, 26 Dec 2000 18:11:36 -0000
I am using Access 97 for my database.  I have a query that runs fine in

ACCESS, but not when I access it from ASP.  On the previous page I have a

table with letters a-z.  The user clicks on a letter and I pass that

letter via a query statement to the display page.  The display page has

the follow vbscript code at the start of the page.



Prior page query string creation.

<td><a href="FirstLetter2.ASP?FA=A">A</a></td>



.....code ....

<%@ LANGUAGE="VBSCRIPT"%>

<%OPTION EXPLICIT%>

<%



Dim ID             ' as string

Dim conGlossary    'ADODB Connection

Dim rsCustomers    'ADODB Recordset

Dim rsRedFlag      'ADODB Recordset

Dim cmdQuery       'ADODB command

Dim parID          'ADODB Recordset 



' CONNECT TO THE DATABASE

Set conGlossary=Server.CreateObject("ADODB.Connection")

conGlossary.ConnectionString= "Provider=Microsoft.Jet.OLEDB.3.51;Data

Source="& server.MapPath("Glossary.mdb")

conGlossary.Open





Set cmdQuery= Server.CreateObject("ADODB.Command") 

Set cmdQuery.ActiveConnection=conGlossary

cmdQuery.CommandText="qryFA"



ID=Request.QueryString("FA")



set parID=cmdQuery.CreateParameter("FID", 129, 1, 1, ID)  

cmdQuery.Parameters.Append parID



Set rsRedFlag=cmdQuery.Execute



%>

.... code end ....



I don't get any records from the database and I know some exist.  If I run

the query in ACCESS with the same data, it works.



Any Ideas?



--- 

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