473,320 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

code to get a query from access to asp page

20
hi
Can anyone tell me how a get a query made in access and view it in an asp page.

Thanks claire
Apr 30 '07 #1
1 1027
jhardman
3,406 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. <%
  2. set conn=Server.CreateObject("ADODB.Connection")
  3. conn.Provider="Microsoft.Jet.OLEDB.4.0"
  4. conn.Open "c:/inetpub/myAccessDatabase.mdb"
  5.  
  6. set rs=Server.CreateObject("ADODB.recordset")
  7. rs.Open "SELECT * FROM myTable WHERE date = #12-13-2006# ORDER BY name", conn
  8.  
  9. do until rs.eof
  10.    for each x in rs.fields
  11.       response.write x & ": " & rs(x) & "<br>" & vbNewLine
  12.    next
  13.    rs.movenext
  14. loop
  15.  
  16. %>
Here's a simple example. Here's a good tutorial

Let me know if this helps.

Jared
Apr 30 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mattyboy | last post by:
Guys I have built a database with saved queries that runs fine in Access but when I call it from the web using ASP, an exception occurs. I have tried multiple ways of testing the databases with...
8
by: RC | last post by:
The following code works well to create an html file that has a row for each row in my table. My Access 2002 database has a tabel with 3 columns labeled, Model, CD and Hard Drive (HD). Any...
1
by: VMI | last post by:
I need to display Access data in a datagrid but the Access table has over 2 million records. Since I can't fill a datatable with all those records but the user needs to see all of them, how can I...
3
by: eselk2003 | last post by:
I'm just starting out with VWD 2008, and new to ASP .NET. I have a master page which displays one record for an Access database based on an ID number in the query string. Then I have a content...
7
by: shalskedar | last post by:
In a query i want to retrieve the value in such a way that if the value for the current record for a given column is 0 then it should go to the next record & take the value. for ex-I 've column...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.