Multiple Table In Recordset

Basically I have the following SQL statement:

Quote: sqlConnect = "SELECT Users.User_ID, Users.Password, Users.Username, Event.Event_ID FROM Users LEFT JOIN Event ON Users.User_ID = Event.Admin_ID where Username = '" & Username & "'"
set rs= Server.CreateObject ("ADODB.Recordset")
rs.open sqlconnect, objconn, 3, 3
where username is an ASP variable of the username.

When I run this and I try to access a field from event I get an error i.e.

Quote: if rs("Event.Event_ID")<>")" then
session("admin")= rs("Event.Event_ID")
end if
Does anyone know what is wrong?!?!?! It doesn't seem to be able to pick up the fields from the event table?

View Replies


ADVERTISEMENT

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

Recordset With Sub Table

have 2 tables that show boat information

Table 1 shows make model price etc
Table 2 shows the information for the images

I have joined the 2 tables as below

Select *
From tbl1, tbl2
Where tbl1.id = tbl2.id

Because there are more that one picture for some of the boats it displays each image as a seperate record

I just want it to show 1 image for each record

Is this possible??

View Replies View Related

Recordset/HTML Table

On the first ASP page I have a form (checkbox) with 20+ different categories. After the user clicks on a few of them, they all have to be transfered on the second ASP page in HTML table. My problem:

If user selects only three categories, they should represent themselves in three differenst columns in my html table(something like Column-Name). If he selects 4, - four differesnt columns in the same table, etc.

So the table has to be 'dynamic'. It should have the same number of categories that the user selected on the first page. Could it be done? After that I should populate every category from a recordset and I know now how to do that.

View Replies View Related

Displaying A Recordset Dymanically In A Table

I am having a bit of trouble with classic asp and tables.

I want to loop through a recordset (easy enough) but I want to display the records in a table with only 3 records in a table row. So in other words each table row needs to have 3 items then a new table row is created dynamically until recordset.eof

Item 1 Item 2 Item 3
Item 4 Item 5.......until eof..

View Replies View Related

Multiple Table Search

I want to do is search through a database based on what was selected on a form.It will be based on state, county, and category.Out of the search I just want one field out of the database, the email field. Now, at first I had one table to mess with so I was using this:

strSQL = "SELECT DISTINCT EMail FROM Info WHERE Category='" & category &"' AND State='" & state &"' AND County='" & county &"'"

the way the database is going to be set up now what I need to do is search through one table that will have all the states, counties, category, and UserID fields.Then it has the other table that will have a UserID field and an email field.So I guess it needs to go through the first table and depending on what state, cat, county were selected it will take that UserID and match it to the UserID in the email table and then pull the emails that match UserID.UserID? Would this use JOIN? UNION? How would this be done, to take the form info and search the one table and then depending on what userid matches the state, county, and category in that table it matches that userid to the userid in the email table and pulls the emails from the email field.

View Replies View Related

[Open][Multiple Table]

Can i open a second table while another table is open within one database? I did attempt but i get this error. Code:

Error Type:
Microsoft JET Database Engine (0x80004005)

Could not use ''; file already in use.

View Replies View Related

Multiple Count On Different Table

I'm trying to do a multiple count on different tables in my database, but it's not working. At the moment I have this SQL query, Code:

SELECT COUNT(*) AS articlecount, COUNT(*) AS faqcount
FROM article, faq;
This doesn't work though. If there are 2 articles, and 3 FAQs, it will still say 2 FAQs
Can anyone give me the proper SQL query, if possible?

View Replies View Related

Create Recordset, Loop, Update Second Table

I am in the process of rewriting my table formats for an Access Project that was created. I now need to get the data from 1 table and transfer to a second table.

I created a page that creates the record set, I then loop through that record set and need to run an update statement to a second table, however, I get the following message:

Microsoft JET Database Engine (0x80004005)
Could not use ''; file already in use.
/BusPlanTest/updBusPlan.asp, line 17

Below is the code I am using: Code:

View Replies View Related

Modify Multiple MDB Table Designs

I've got quite 20 identical MDB files running on an IIS5 server. From time to time I need to go into various tables and add a field or two. It would be great if there were an application out there that could either: sync all MDB designs (and/or data) esignated to match one I've added some fields/tables to OR go into all designated MDBs and create new field(s) or table(s).

I've began writing something like this that right now just does part of (b) but I'd rather find something that is much more slick and complete.

View Replies View Related

Return Recordset Of Images In Specific Cells In A Table

I have an interesting problem and am looking for some advice. I am
hoping to build an asp whereby records are pulled from SQL Server. These
records will be merely file locations for thumbnail images I hope to display
in a grid.

Rather than having a grid be constructed row-to-row, I was
wondering if it is at all possible to dynamically construct this grid as a
table of thumbnails whereby each cell (perhaps 5-6 columns across)
represents one record? I have no idea how one would construct this loop that
spans columns AND rows rather than just rows.

View Replies View Related

Create A Recordset With Multiple Tables?

My database has customers, orders, and orderDetails tables. I'm trying to create a page that we can access to lookup all details about our orders. That page will need information from all of these tables.

How do I create a recordset that can handle the relationships and bring in all data?

View Replies View Related

Edit Multiple Records In A Single Table

I am using a db to hold student data records. I currently display them in a roster based on their affiliation with a certain class. To edit a record I need to click the name of an individual, it opens an edit page, I make the changes, hit submit and return to the roster.

This is pretty standard stuff. What I would like to do is change one field of every record without opening each record individually. The idea comes from my Fantasy Fball league roster:

McNabb, Donovan QB PHI ActiveReserve
Droughns, Reuben RB DEN ActiveReserve
Johnson, Rudi RB CIN PIT ActiveReserve
...etc...

Where the example above says "ActiveReserve" is a pull down menu that lets me change who is playing week to week. I can then change each record, hit submit one time, and update the db. So how do they do it?

View Replies View Related

Insert Multiple Records Into The One Table At The Same Time

Does anyone know how to insert multiple records in the same table at the same time. This is what I have. I have a form with 6 fields and they are name prod1 through to prod 6. The table is called related products.

Basically this table is related to the main table called prod_parent. tried looking on google and couldn't find anything.

View Replies View Related

How To Update Multiple Records Into A Single Table

I already have this piece of code that inserts multiple rows of data into a single table at once. Code:

View Replies View Related

Email Multiple Recipients From Recordset (jmail)

I'm trying to send an email (jmail) to everyone in a recordset but I'm getting no joy,I keep getting a "not all servers received message" error or something similar, can someone please take a look at this code and see if they can spot my glaring errors ?

<%
set rsetReminder = Server.CreateObject("ADODB.Recordset")
rsetReminder.ActiveConnection = MM_connmessages2_STRING
rsetReminder.Source = "SELECT * FROM accessgroups WHERE ((accessgroups.fldjoined<Date()-14)) AND fldGroup = 'Guest' ORDER BY fldjoined DESC"
rsetReminder.CursorType = 0
rsetReminder.CursorLocation = 2
rsetReminder.LockType = 3
rsetReminder.Open()
rsetReminder_numRows = 0
%>
<%
While NOT rsetReminder.EOF
firstname = rsetReminder.Fields.Item("fldFirstname").Value
lastname = rsetReminder.Fields.Item("fldLastname").Value
emailadd = rsetReminder.Fields.Item("fldEmailAddress").Value
username = rsetReminder.Fields.Item("fldusername").Value
password = rsetReminder.Fields.Item("fldPassword").Value
usrid = rsetReminder.Fields.Item("fldnewuserid").Value

crlf=chr(13)+chr(10) .....

View Replies View Related

Multiple Recordset Export To Excel Worsheets

I know how to read data from an MS Excel file, just as if i amreading it from an Access DB with recordsets and stuff like that.

Want i'm wanting to know is:

is there a way to export 2 different recordsets that I have loaded into 2 different "sheets" within the one Excel file

I can export 1 or more recordsets to 1 Excel sheet, but I really need to export them to individual sheets in the same Excel file.

View Replies View Related

How To Pass A Recordset Or Form Between Multiple Asp Pages

Users enter data using HTML forms and it gets processed by an asp page that enters the data into the database. What I am trying to do is get a "confirm" page set up that will make sure the form was completed properly. If it is completed successfully, then the data from the form needs to be forwarded onto another asp page that will enter the data into the database.

My question is, what is the best way to forward the information on? Currently I am using querystring to handle this, but that doesn't work in some situations especially when one of my forms has a <textarea> box that seems cumbersome to send via querystring.

Is there a method I can use to easily forward the data from the form to subsequent pages after the first one ?

View Replies View Related

Clone/duplicate Recordset Spanning Multiple Tables

I would like to dulicate a selected record. Sounds easy enough like performing another INSERT operation. However, that solution only works if the datasource is only one table.

I have 4 different tables all linked to the main table through a unique primary key (auto number). When a user clicks a button to clone a record, all related records from the other tables must also be duplicated using the newly assigned ID that matches the one from the main table.

Hopefully I didn't confuse you. Consider it like a multi-step process of filling out different web-based forms but using the same unique id.

I don't know the first place to start on creating duplicate entries based on existing records. If you can start me with the code, I could probably follow the logic. THe difficult part for me to conceptualize is how to carry this new ID to all the other tables.

View Replies View Related

How To Trigger OnChange Or OnClick Events For Multiple Rows In Table??

I can trigger these events successfully if table only has one row:

Sub InputField_OnChange()
......
End Sub

But, these events cannot be fired if table has more than one row, why?

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

Error Type: ADODB.Recordset (0x800A0BADODB.Recordset (0x800A0BCD)

Last week, my shopping cart was still working well until I began getting the following errors 2days ago..

Error Type:

ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
../order/saveorder.asp, line 157

Browser Type:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)

Page:
GET /main/saveorder.asp

Could you check my code below and let me know what possibly the error is?

View Replies View Related

SQL Server - Update/Insert Multiple Cols Into Multiple Tables

Just as the title says I am trying to do something impossible with a single SQL statement. I am doing an ASP webpage for internal use at the company I work for.

I want to know if there is a way to insert/update data into multiple tables in 1 SQL statement.

If it requires functions | views or anything else that is fine but I don't want to have 3-4 different SQL statements to update 2-3 different columns in different tables.

View Replies View Related

Searching Multiple Memo Fields In Multiple Tables In Access

I have a search option on my website, which should perform a search on 4 fields, as follows:

tblNews
headline
content

tblDatabank
filename
description

It only needs to return matches which are an exact match of their search criteria. For instance, searching for "I am here" would return a record which contained "I am here", but not just "I" or "I am" etc.

I need to return all these records as part of one recordset preferably, as I want to be able to order them etc., though I imagine you may suggest I use an array somehow to merge two recordets etc., then reorder them?

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

Best Method Of Updating Table From 2nd Table

I have two tables. Table A has 20,000 records, Table B has 2,000 records. Table A is what needs to be updated from the data in Table B. Only some fields will be updated and of course, only some records - both tables have the same field as a ClientID so matching up records should be easy.

Anyways, been a while since I have used ASP to work on things like this but would like to work through this one. I understand the process I believe, it is just how to make it go on to the next record once it has finished updating the first.

Basically, I was thinking of having it set up to reaad the top record from Table B, update applicable data in Table A. Delete that record in Table B. Move on to the next.

View Replies View Related

Recordset Controlled By Another Recordset Within A Loop

I have created a forum, in which I have 3 tables:

1: Table_Forum
2: Threads
3: Replies

I have it at the moment that on the main default.asp there is a recordset that will
display all records within that table, these are a list of forums that will be available.

I have a table that will show the forum name, and the description. This table is then looped using Do while not, now what i need to do is show how many records in the Treads table are related to each forum using asp. Code:

View Replies View Related

How To Update Multiple Records With Different Multiple Value

i hav problem with updating the data. In the asp page i hav displayed records based on search criteria. in display mode im displaying the to be updated field in combo box for each similar contract_no. each contract_no will hav different no of rows and to be updated combo box.

based on the selected value in the combo boxes of different contract_nos i hav to update the combo value with old value. user select multiple combo values at a time I need anybody's help with detailed programming logic.

View Replies View Related

Record Set For Id From Table 1 To Table 2

Hello I have a page for registering users.

I am reciveing this error:

The following errors occured:
- An error occured. -2147217904 : No value given for one or more required parameters.

there are students and teachers. therefore I have 3 tables one for logins and one for staff and on for students.

I have a form designed to capeture the need information.

in the code I am runing an if and elseif statmetn to determin the tables. I then insert the userid and password into the login table.

then i enter the remaining information into ither the staff or student table. what i am trying to do is select the perimary number that is generated as the userid and passeword are enterd. and add this to the second table. Code:

View Replies View Related

How To Make Column Of Table 1 = To Column Of Table 2?

I want MS Access 2000 database column of table 1 = column of table 2. This is what I was doing: Code:

View Replies View Related







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