Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2004, 02:01 AM
Registered User
 
Join Date: Mar 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP to Access Database

I have a database which have several tables and some of the tables have same field names. For example, I have field call "name" in both Customer table and Vendor table.

I have one query which join those two tables together. I like to print out both name in customer and vendor table.

BUT
RS.Fields("Customer.name").Value
RS.Fields("Vendor.name").value

both statement gave me not found in record. It is perfect fine in access. I don't know if it different way of calling each field

Please help

 
Old March 3rd, 2004, 04:12 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Column names for the recordset should be unique, and unfortunately, you can't use the Table name prefix in the Recordset syntax as you found out. What you can do is alias your column names, and use that alias to retrieve the value:

SELECT Customer.Name AS CustomerName, Vendor.Name AS VendorName, Bla bla bla

Now, in your recordset, you can use CustomerName and VendorName like this:

RS.Fields("Customername").Value
RS.Fields("Vendorname").value


HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Access link database to ASP apple88 Classic ASP Databases 1 July 10th, 2007 07:38 AM
Access issues with ASP and a MS Access Database rj_conceptsnrec.com Classic ASP Databases 2 May 19th, 2005 12:44 PM
connection to Database. ASP, Dreamweaver, Access CrazyCanuck Classic ASP Basics 2 July 4th, 2004 09:12 PM
Writing to access database from asp.et RaZorCleaN Access 2 October 9th, 2003 01:16 PM
Can't update Access database under ASP with ADO bnorg ASP.NET 1.0 and 1.1 Basics 6 September 16th, 2003 02:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.