How To Retrieve The Data From Last Record Of The Query?

I have 2 tables Table_A and Table_B are linked together by TaID

Table_A
TaID - autonumber
Name
Address

Table_B
TbID - autonumber
TaID
Comments

here is my asp page
-------------------------
<%@ Language="VBScript" %>

<!-- #include file="connectionstring.asp" -->

<%
'declare variables
DIM ......

'Assign Variables
.......

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

'database connection
Conn.provider = provider
Conn.ConnectionString = dbasepath
Conn.Open

'Sql statement to insert the data
sql = "insert into Table_A ( Name, Address) values (...*data from form*...)

' execute it
Conn.Execute(sql)

Response.Write "Data successfully inserted!"

Conn.Close

Set Conn = Nothing

--------------------------------------------

my question is I also need to insert the data to Table_B, but before that, I want to retrieve the Table_A.TaID first.

so if i do "select TaID from Table_A" and execute the sql how do I assign just the LAST record of TaID and assign to temp variable?

Do I allow to do that? if so, where should I put in the code above?

View Replies


ADVERTISEMENT

How Do I Retrieve The Key Of An Inserted Record

I have to tables related to eachother,

like for example

an Emlpoyee table which has an Auto Number as primary key and as the ID of the employee.

And Employee_Phones which has 2 fields the Employee's ID and the phone number field.

when I insert a new record in the Employee table, I want to insert multiple records related to it in the Employee_Phones table.

After inserting a record in Employee table I want to retrieve the ID, then use that ID to insert other records in Employee_Phones table.

Is there a command of function to return the ID of the inserted record, Or do I have to query the database again? I've loked for a function or a method but I didn't find any?

View Replies View Related

Retrieve Inserted Record

I have a form to submit a record to a database and immediately after it's submitted I want to send an email with a link to that record. How can I retrieve it's ID (which is an autonumber) from the db to write it into the querystring of the link?

View Replies View Related

Retrieve Only The Most Recent Record

I'm using SQL to pull records from our db but my query is returning all results in the db table and I only want the most recent entry. There is a date_time column in the format MMDDYYYY HH:MM:SS and I'm using that to order by then writing only the first line which works, but is very slow since there are a lot of records to go through.

What I'm looking for is a way to only retrieve that most recent record instead of pulling them all, then ordering them. Would I be able to use the MAX function for something like this? Does MAX work with a date_time field?

View Replies View Related

How To Retrieve Multiple Images For A Record

In my Access database I have multiple images for some of the records. What is the best way to retrieve and display the multiple images. I am storing the images in a folder and only the path in the DB. Some of them have just 1 image, some 2, some 3 and so on. I have the record ID # and the image name same, for eg. if the record id is R01 then the image name would be R01.jpg if there is only 1 image otherwise R01a.jpg, R01b.jpg, R01c.jpg etc. Is there any way I can open the folder and check for the name and list the image file names as a link to display the images if the ID name and image name matches.

View Replies View Related

Retrieve A Record Identity From A Mysql

is there any way I retrieve record identity from data that i just insert in...

View Replies View Related

Retrieve Data

I have two tables having similiar columns ( i had to do this to compare the values given to me, because both the table data came from different sources)

The tables named are
OFFICERS
token
full_name
division
EMPLOYEE
token
full_name
division

Now the table EMPLOYEE contains more than 5000 records and the table OFFICERS contains around 2400 records which are already present in the EMPLOYEE table.

Now I want to build a query that will return me all the records in the EMPLOYEE table that are not present in the OFFICERS table. The criteria for comparing 'full_name'. so the query should return me 2600 records that are not present in the OFFICERS TABLE.

I tried doing this
" SELECT DISTINCT EMPLOYEE.full_name,EMPLOYEE.token,FROM EMPLOYEE,OFFICERS WHERE EMPLOYEE.full_name<> OFFICERS.full_name"

But this query returns me records that is not present in the OFFICERS table as well as some more 1000 records which are present in both tables.
thanks a lot

View Replies View Related

Retrieve XML Data

I am trying to access the following site with an asp page. I am just starting out with XML
URL

This is my stats page for battlefield Vietnam. I have managed to get a local verison to work if I save the source code of the page above as an xml file on my server, and I use the following code:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Option Explicit %>
<%
Dim xmlDoc, root
Dim success, player, strData, online ,rank, rp, score, kills, deaths, fttk, kdr
Dim dpm, ftpm, mppr, medals, gold, silver, bronze, rounds
Set xmlDoc = server.CreateObject("msxml2.DOMDocument")
'

What I can't figure out is how to access the data from the external site.

View Replies View Related

How Can Retrieve The Data In DDL ?

This is my code can you fix it if it have an error

<select>
<%
set rs = Server.CreateObject("ADODB.Recordset")
strSQL = "select cat from events"
rs.ActiveConnection = conn
rs.open strSQL
if not (rs.eof or rs.bof) then
for i = 0 to rs.eof
response.write("<option>" + rs(i) + "</option>")
next
end if
%>
</select>

View Replies View Related

Retrieve Data

how to retrieve a data that has been selected using combo box with asp

View Replies View Related

Retrieve Data

How can I retrieve data from Ms Access Database which is located in another computer over the network.

View Replies View Related

Retrieve Data

I have a question, is that any other way to retrieve data from another webpage besides using XML object? Because I am using XML object now but give me so much problems.

If I used MSXML2.ServerXMLHTTP object, it gives me time out error:
msxml3.dll error '80072ee2'
The operation timed out

If I used Microsoft.XMLHTTP object, it will hang IE. In both cases, I have to wait for half an hour or more in order for the XML object to be working again. Actually both webpages that's communicating are hosted at the same machine. The main site (ex. aa.domain.com) points to particular folder under it, while another one (ex. bb.domain.com) points to another folder which is two levels up to the first one.

View Replies View Related

Retrieve Data From URL

I am trying to get informaton off the URL to display in dropdown menu with asp. not from xml file but data from a URL.

View Replies View Related

Retrieve Data

I have problem like that. page1 is sending some variable data to page2 Now page2 have to decide whether it has to redirect it to page10,page20 or page30 basing on the value of a variable1 which is in page1 variable data. I want know how i can access variable data of page1 in page10,page20 or page30.

View Replies View Related

Retrieve All Data From A .msg Or .eml File.

I'm working with JMailBox app. This is an asp web based pop3 client.

The application has a inconsistency: when forwarded mail arrives, the
system transforms the message into a .msg and .eml file, but this cannot
be displayed on an ASP page. Some times the forwarded message contains
attached files (.doc .xml .pps .pdf .html .zip etc.). These attachments are
those that interest to me to recover.

Hopefully that somebody can help me to find the solution to recover the
content of a .msg or .eml file, including attachments with pure ASP.

View Replies View Related

DB Data Input & Retrieve

I have 4 ASP pages on my site & a DB for each page has a
form pointing at its DB, I thought this would be the
simplest way. You can add & submit data and you get the
confirmation page, but I am seeing no data in my DB's.
Each DB has a CHMOD of 777. Here's the link to what I am
doing most of the test just read "SOME TEXT" Code:

View Replies View Related

Retrieve Data From Ms Access

How can I retrieve data from Ms Access Database which is located in another computer over the network.

View Replies View Related

Retrieve Yesterday's Data

my database table have 1 field is use for record the date.Please help me to program the code, so i can retrieve the data recorded from yesterday. That means everyday retrieve yesterday data automatically.

View Replies View Related

Retrieve Data From MS Access

I am trying to retrieve some data from a table which is the link table from another Ms Access database of my network computer but i got a error message "It is already opened exclusively by another user, or you need permission to view its data."

View Replies View Related

Retrieve Access Data

I am using access database to store test results. Each test is asigned a automatic ID number in access. I have all the data collecting fine to the correct columns but had to add a new column named (comments) to the database and this column is made to store students comments on the tests. I created a new, view comments page where the students can view comments on the tests.

The problem I have is, I need to be able to bring up the info from the comment column by that asigned automatic id number thats asigned to the test. I can get it to show all comments on all tests but need to be able to view comments on each seperate test and each test has a diferent automatic id number.

How can I bring up the comments to view by the automatic number thats asigned to each diferent test? We need to view all comments that were made to each individual test by that tests automatic id number and using asp. This has got me puzzled to view comments to each individual test thats asigned with an automatic number generated by access database.

View Replies View Related

Retrieve Data X Days

I want to retrieve data that 30 days before or 60 days before from access. How can I do it.Using vbscript or SQL language or both?

View Replies View Related

Retrieve Access DB Data

A customer reports a problem with a site that is unable to read utf-8 data from an access data base. The page only shows ? instead of text.

The parameter that turns Unicode support on/off is "on"
DRIVER={Microsoft Access Driver (*.mdb)};useUnicode=yes;
DBQ=C:Inetpubvhostsdomain.comhttpdocspath_to_dbname.mdb [no spaces, so that's not the problem]

Successfully tested ODBC connection -- but still can't read the data. The site has the content type set to CHARSET=utf-8.

View Replies View Related

Running At Client To Retrieve Data

there are specific client of mine and there is a big database which i have to handle it, every time clients want to connect to this specific database it takes long time, this database is a static database it means you dont have to edit or update it by the clients, it is like a dictionary, you type your words/code and you will see some data,

I could not find a way to reduce the time for the clients(due to the big database), I am wondering that is it possible to put a copy of this database on client's computer (I have mentioned that there are specific clients and I have access to their computers) within Access Database so in this way I have to run the connection to the access database at clients side, if so what is the coding for it??

View Replies View Related

Retrieve Data By Month And Year

How can I retrieve all the records from the database having the following parameter:

in form, these are the fields to be entered:

month (it's a select option)
year

Then from the database the field objrs("strDate")

Scenario: User entered the ff:

month = January (with the value 1)
year = 2004

if in the database the input for the strDate field is having this format: 1/2/2004

How can I retrieve all data for January?

View Replies View Related

ASP With MS Access To Retrieve A Specific Data

Is there any way by using ASP with MS access to retrieve a specific data from a table and when i retrieve i want to show me the data without repeating the same data or duplicating data and i want instead of this to count for each item how many row is there in a the table ....... loooool i know that most of you will tell me to re-explain what i want to say again ... ?
For example i had three rows in the table ... and those rows are the same with 4 attributes ... what i need is to retrieve those rows in the website .. but instead of showing three rows it will show me one and next to this row i want to put 3 which is the number of the rows in the table that are the same and if i have any other rows it will do the same ...

View Replies View Related

Record Count Query

I'm trying to do a simple record count from my Access table but when it runs I keep getting a result of -1 when it should be over 50.

<%
set rsKaCon = Server.CreateObject("ADODB.Recordset")
rsKaCon.ActiveConnection = MM_jsb_stk_STRING
rsKaCon.Source = "SELECT * FROM USDSTOCK WHERE Modelcd = 'Fiesta' "
rsKaCon.Open()
rsKaCon_total = rsKaCon.RecordCount
%>

And the result should be Code:

View Replies View Related

Use Value In Query String To Produce Multiple Record Sets

I have taken over a website that was done in Frontpage and I am trying to move away from it. I am having problems with page 1 where I have a link that passes a single value to page 2 in the query string.

On page 2 I want to use that value in the query string to produce mulitple record sets. This actually works when using the fpblib.inc. Is there a way of doing this without having to use Frontpage coding.

View Replies View Related

Hiding Blank Record Data

I want to display the contents of a field with a label if there is data in that field. If there isn't then I don't want the label to appear. I tried this:

<%If Venueinfo("email") = "" Then
Else%>Email: <a href="mailto:<%=Venueinfo("email")%>">Click to
email</a><br><%End If%>

But it doesn't seem to work. It seems to always display the label and link even though there is no data in that field.

View Replies View Related

Use A Record Data For Page Title

wondering if you can do this in asp

<title>
<%
Response.Write Recordset (Title)
%>
</title>

View Replies View Related

Find And Return Data From A Just Submitted Record.

I have a page where a user can submit a record for a new "applicant". After the user clicks Submit, I would like to send the user to a new page containg the "Applicant Number" which the user will need.

The applicant number is simply the autonumbering of the record in the table which is in a SQL Server db. How do I capture the record number(primary key) of the newly entered record in the table and send it to my new page?

View Replies View Related

SQL Query On Form Data

I need to select the data where the data ID is equal to the variable supplied in the submitted form. Below is the line of code I used for the radio select and the code to do the SQL search on it. I get the following error using this code:

Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/MyWeb/CheckIn.asp, line 93

The items are listed by ID 1-X.

<input type=""radio"" name=""CheckIn"" value=x.value>Check In<br>

Dim junk
junk=request.form("CheckIn")
'If Session("UserType") = "User" Or Session("UserType") = "Admin" Then
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db1.mdb")
Set rs=Server.CreateObject("ADODB.recordset")
'in below, WHERE id = Request.Form("CheckIn")
SQL = "SELECT * FROM CompsIn WHERE ID = junk"
rs.OPEN SQL, Conn, 3, 3

rs.OPEN SQL, Conn, 3, 3 = Line 93

View Replies View Related

Moving Data From A Related Record Derived Rom A Drop Down To A Text Box

I am relatively new to ASP but am fairly familiar with PHP and ASP.NET and JavaScript.

My problem is this:

I have a drop down box which is populated from the database (Access), it sets the value to the ID of a hospital ward, and the text to the name of the ward.

I then use the ID to look up an email address for the manager of the ward from another table in the database. My un-optimised code is as follows: Code:

View Replies View Related

ASP SQL Query Error With Data Types

I am trying to use a query to filter SQL Server 2000 records by a date
value.

Here is relevant columns in my database table (tblContent):

title [nvarchar]
starting [smalldatetime]

.... and here is my query:

Query = "SELECT title FROM tblContent WHERE starting = '" & date & "'"

I've done exactly this query on numberous occassions in the past with no
problems at all but this time I get the following error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of char data
type to smalldatetime data type resulted in an out-of-range smalldatetime
value.

What on earth is going on? I'm not using a char data type anywhere! I am
doing all the initial development locally and I have just installed XP
Service Pack 2. I realise it's unlikely, but that's the only thing I can
possibly attribute it to. Or am I just missing something obvious?

View Replies View Related







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