Querying Two Table In One Select

Is there any way to quiry two tables in one select command to limit the number of database connections. One quire displays members from a members list the other quires achievments for each member. i.e.

select name, memberno from memberlist
then select * from achievements where member = memberno

currently this is done by a loop which requires lots of connections

View Replies


ADVERTISEMENT

Problem On Querying Access Link Table In ASP Page

I connected MS Exchange Server to MS Access database using Access link
table function. I can open the database table and see the fields and
data inside the link table. However, the table seems cannot be queried
by SQL statement.

My situation is:

I'm building an intranet. I have a ASP login page for all staff in the
company to login. Other people can't register or login the intranet.
That's the reason I use the company email address to verify username
login name.

After I made the link to the Global Address List (rename to
StaffList), I can see the Alias field. I wrote ASP code to use Alias
field to verify user login name. But, the ASP page seems experiencing
difficulties. I always got the "Connection Timeout" Error. Code:

View Replies View Related

Select All From One Table That Are Not In Another

i have to tables:

table 1
FID
username

Table 2
FID
filename
display name

i need to show all fids from table 2 that are not in table 1 for username justin.

View Replies View Related

Complete An Access Table Through A Select List

I would like to know if it is possible to fill in an access table through a select list inside an APS 3 web page. If yes, how ?

View Replies View Related

How Can I SELECT By Two Fields In A Linked Table (2 Degrees Away)?

How can I do this in a single query (or query-subquery)?

Return the Rows of all books in the CATALOG that...

- are tagged with one category

- are also tagged with a second category

CONTEXT:
This is a 3-table db
Many-to-many (each book may have many categories & v.v.)

- bookCatalog is the main table (with fields for each book's unique data, primary key is Ref_no)

- bookCategoriesLinkTbl is the linking table (it has two fields: category_ID and Ref_no)

- categoriesTbl has only 2 fields: category_ID and categoryName
It's an Access 97 db Code:

View Replies View Related

Integrating Asp Into A Table To Auto Generate Rows From A Select Statement

Im running a select statement to a database and wish to display the relevant records into a table. For some reason, its not liking this - can someone see why, and or tell me an easier way to produce an 'automatically generating' table of results.

<% @language="vbscript" %>
<% Option Explicit %>
<% Response.Buffer=True %>
<html>
<head>
<title>Search Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<!-- #include file="dbConn.asp" -->
<!-- #include file="adovbs.inc"-->
<h1>Your search results returned the following popup messages:</h1>
<% Dim msgtype, title, message, url
msgtype=request.form("type")
title=request.form("title")
message=request.form("msg")
url=request.form("URL")

Dim adoDB, adors, strSQL
set adoDB = Server.CreateObject("ADODB.Connection")
adoDB.Open strConnection
set adoRS = Server.CreateObject("ADODB.RecordSet")
strSQL="SELECT PID,P_TITLE,P_MSG,P_URL,P_TYPE FROM POPUP WHERE ("
If msgtype <> "" then
strSQL=strSQL & "P_TYPE='" & msgtype & "' "
If title <> "" then
strSQL=strSQL & "OR P_TITLE LIKE '%" & title & "%' "
If message <> "" then
strSQL=strSQL & "OR P_MSG LIKE '%" & message & "%' "
If url <> "" then
strSQL=strSQL & "OR P_URL LIKE '%" & url & "%' "
End if
strSQL=strSQL & ")"


'DEBUG ONLY!!
'response.write strSQL
'response.end

adoRS.Open strSQL, adoDB
' Loop through the recordset to display the records
Do While Not adoRS.EOF
& " <tr> " &
& " <td> " & Response.Write adoRS.Fields("PID").Value & " </td> "
& " <td> " & Response.Write adoRS.Fields("P_TYPE").Value & " </td>"
& " <td> " & Response.Write adoRS.Fields("P_TITLE").Value & "</td>"
& " <td> " & Response.Write adoRS.Fields("P_MSG").Value & "</td>"
& " <td> " & Response.Write adoRS.Fields("P_URL").Value & "</td></tr>"
adoRS.MoveNext
Loop
& " </table> " &


' Tidy up afterwards
adoRS.Close
Set adoRS = Nothing
adoDB.Close
Set adoDB = Nothing

%>

</body>
</html>

View Replies View Related

SQL/ASP Querying

I created an ordering system using DMWMX 2004, and Access DB. On one page I have an insert form and below a display table that shows their orders and calculates dynamically the value of those orders.

As is right now, the display table show orders for 7 days, but It doesn't discriminate what 7 days. I want to be able to display only orders from monday to Sunday until 5pm.

View Replies View Related

Querying The First Record

how to locate the first record...i sorted the numbers and i want to display the first record based from the query...

View Replies View Related

Querying 2 Tables

I have a database with 2 tables in it.

Each table contains the fields: ID(autonumber),Title, Artist, Description, DiscNo, and TrackNo. The second of the two contains an additional field: Price.

How would I make an asp page in which a person enters DiscNo and Price into a form and the code would read all the fields of that record from table1 and then add those and the Price into table2?

View Replies View Related

Querying A Recordset?

I have a recordset that pulls a list of products that a customer has purchased within the past year to date.

Now I need to sum up the total quantity by month that the customer purchased during that time period and dump all of that info into an html table. I am wondering if it's possible to query the first recordset instead of creating a new nested recordset.

View Replies View Related

Querying From Two Databases?

Given if tables A and B are in the same database, writing a query for them is relatively easy. But what if tables A and B are in different databases? Is it possible to query them together? If so, can anyone provide a generic example?

View Replies View Related

Querying Sql Server

I'm having trouble retrieving one field from a table. Bascially i have two asp pages. On one u select a company field this then loads another page that finds the company details and posts it back to the first page etc.

Problem: The address field has line returns in it. When there aren't line returns it works perfectly otherwise it comes back with 'unterminated string error'.

In query analyzer my query works and i can use replace or update statements to remove
them in query analyzer however when i try that in an asp page it doesn't work.

View Replies View Related

Querying A Database Through An Image

I'm building a path making tool, that is i have a network of paths for a park and each section of the path is its own image.

What i need to do is, when a certain piece of the path is clicked, it querys my path database and returns the information for that section of the path to a table.

Im designing in ASP VBscript and database is connected n all but im a beginner, is it feasable?

As well as this i need to be able to add to the table each time a piece of path is clicked, and also take away, like a stack.

AND aswell as this i need a seperate table which adds up the length of all the paths selected (length is in the database).

View Replies View Related

Only Querying Once, Passing Arrays

just wondering if this is possible. i have a page where option boxes are dynamically generated. each time they change the form is submitted, so that it can populate another option box.

these are both database driven, and i was hoping that i could query the information from the database first and then load that into an array/record source. my next task would be to have that array/record source be passed once the page is submitted so that i can use the information again without re-querying the database. (its an efficiency thing) is that even possible? if not what other options do i have?

View Replies View Related

Querying Multiple Tables

I want to query multiple tables (all with exactly the same field names) and then display the records returned in date order.

I've written the SQL to query all the tables (they start with the same name, but end with sequential numbers), but it's returning no records when I know there should be some. Any ideas? Code:

View Replies View Related

Joining/querying 2 Recordsets?

I�ve got 2 recordsets, 1 called �special� and the other called �A55�

Special has a field called �Email_Address��.

A55� also has a field called �Email_Address��.

What I need to do is display all of the records in the recordset �A55� but only the records where the email address field is in the "special" recordset I am using ASP so is the solutions ASP or SQL and how is it done..

View Replies View Related

Querying A DateTime Field In An SQL DB Using ASP

I have a small (still) SQL database, which I am trying to query from an ASP
page.

The field I am querying is of DATETIME data type, and is populated
automatically using the GetDate() function as a default value.

When I try and search on this field, using a date/time in the format
dd/mm/yyyy hh:mm:ss as the search criteria, it fails with the following
error:

[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data
type to a datetime data type resulted in an out-of-range datetime value.

Can anyone tell me why this is? Surely if I am passing a value in the
correct format for the data stored in the field it should work? Or am I
missing something.

View Replies View Related

Querying Msx 5.5 Public Folders

Would anyone have a way to access certain Exchange public folders that
contain news group emails, perform a query on the folders for keywords and
return a list of those emails?

Basically, I've been asked to put a simple
single field on a web page that will query a list of exchange public folders
and return a list of those emails that have a key word match.

sort of like the MS Index server does on folders with files where one has an
asp interface to query the index data base.

View Replies View Related

Querying Single Quote

I have a rather basic question. I have a simple username and password front end that queries a SQL database, I run into problems when one of the user names has a single quote in it (IE: O'brian).

I get the "Microsoft OLE DB Provider for SQL Server error '80040e14' Line 1: Incorrect syntax near 'brian'." error message, any clues on how to display those particular cases? is there anything in particular that should be done to my SQL statement?

View Replies View Related

SQL Connecting & Querying Function

Does anyone have any functions to start a connection to the database and to query a database instead of typing it all over.

I am new to asp and i got a few days to learn it to get started on my sch project. I have the php database abstarction class, wondering is there any for asp and how do i go abt using it?

View Replies View Related

Database Querying Times

I ported a script I made over to SQL Server 2k from Access and went from queries that took a tenth of a second to up to 30 seconds! Typically they are between 5-10 seconds.

All I can think of is I screwed something up in the connection procedure, and here that is:

Code:
set objConn=Server.CreateObject("ADODB.Connection")
objConn.ConnectionTimeout=30
objConn.Open "Driver={SQL Server};" & _
"Server=ipaddress;" & _
"Address=ipaddress,1433;" & _
"Network=DBMSSOCN;" & _
"Database=databasename;" & _
"Uid=userid;" & _
"Pwd=userpass"
set recordset=server.createobject("adodb.recordset")

View Replies View Related

Problem In Querying A Data Field

I'm trying to select all the records of a Database that have the value of the "giorno" ( giorno = day in english.. i'm italian) field bigger than today.... but there's something wrong in my query. The date is in the format dd/mm/yyyy Code:

View Replies View Related

Querying Msx 5.5 Newsgroup Public Folders

we would like to be able to put a simple query field on a webpage whereby users could enter keywords and then have some of the msx 5.5 public folders searched and return a list of those emails that match the criteria. would anyone know how that might be done useing asp and mapi?

View Replies View Related

Querying IISMimeMap .. Access Is Denied

I wrote a Windows Form Application to query the IIS MimeMap on the localhost which worked fine.

I ran the same code in asp.net and got "Access is Denied" exception. What is the least permissions set I should grant the aspnet account to avoid the exception. Or any other suggest would be fine Code:

View Replies View Related

Multiple Drop Down Boxes Querying A Database

This is the solution needed to have Multiple Drop Down Boxes querying a Database(s) that will not wash out you other textboxes and objects on the select. Copy the code, change the connection to get you data and fly. Code:

View Replies View Related

Querying Active Directory For Current User's Info

I'm working on a logon script that needs to query AD for the current user's information. Phone numbers, email address, etc. One thing that makes it a little bit more difficult is that I don't have the full dn for the user; I only have the base dc and cn.

Microsoft's documentation on all of this is lacking greatly, so I've been racking my brains quite a bit.

View Replies View Related

Querying More Than 255 Characters From FoxPro/DBase Database Field

I've been tasked with integrating an older management system based on
DBF files with my snappy new ASP application to provide users of the
ASP application with real-time data from the management system.

I figure with DBF files, I should use either the DBase drivers or the
FoxPro drivers to connect to the database. Code:

View Replies View Related

How To Transfer Records From One Table Of A Database To Another Table In Another Data

I have aproblem to transfer a data from table x to table y based on id. Its mean when 2 table have same id all data table x must move to table y. I don't know which command need to use is it insert into or update?

<%
Dim conn
Dim rs
Dim MYSQL,MYSQL2

Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Set cmd = Server.CreateObject("ADODB.Recordset")
conn.ConnectionString = "DSN=prmm;UID=administrator;pwd=sa"
conn.Open

startdate=request("tarikh1")
enddate=request("tarikh2")

MYSQL = "SELECT * FROM table_x where paymentdate between '" & tarikh1 & "' and '" & tarikh2 & "'"
rs.open MYSQL,conn ....

View Replies View Related

How To Open A Recordset For A Table Has Space In The Table NAME?

I am trying to display the content of a Table called

'Order Detail' directly from the database (e.g., Northwind.mdb). I have the following commands:

Set tableSet = Server.CreateObject("ADODB.Recordset")

tableSet.Open table_name, DB_name, adOpenForwardOnly, _
adLockOptimistic, adCmdTable

where, table_name = ''Order Detail" Or
table_name = 'Order Detail' Or different variations.

I always get error on the second command with the following message:
Syntax error in query. Incomplete query clause

which I believe because of space in the Table Name. How can I resolve this issue? (working with file or table name with space)?

View Replies View Related

Table Inside A Table Update To DB

I have a table with many txt boxes which i have inside a form with a submit button to an update page which adds all the details to a db. The problem is i have a another table inside the first e.g. table 2. i want to be able to update table2 by clicking a second submit button that would update it. Is it possible to have a form within a form or how can i do it??

Also i need to update the entire table in one go. For exampple if i have 3 records in table2 i want to be able to update them all by clicking the one update button. Code:

View Replies View Related

Copying From Table 1 Inserting In Table 2

I have the following code but this is inserting manually. I want to make a query from table 1 and automatically enter the records into table 2. What needs to be modified? Code:

View Replies View Related

Bookmarking A Position In A Table <table>

Have an app which dynamically creates table rows depending on records, these can be several hundred (don't ask). Hence a very long page at time. Each row includes a hyper link to a new page, and a link back to the original page.

Is there any method (maybe via js) where on leaving the second page l can redirect the browser to the table row the end user clicked on? Hence the bookmarking. Can do this via Visual Basic on the desktop app, but can't work it out on the web app.

View Replies View Related

How To Get Data From A Table Into A Table Form?

I have a table produced with names across the top and services down the left hand side with boxes for numbers for people who recieve services then the info is written into a table in an access db. That works fine and here is that code:

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved