Show New Inserted Record

iwana code with aspwho can help me?think that i make a interface which with sql sttement lsted all the records in the one table.another one at that time inserted a new record.so iwanna have a cod that listedrecords (when that record was inserted) and i see all the record(cotain the new record) again.plz help me and show me a code.my mail is kianoosh_ardavan@yahoo.com

View Replies


ADVERTISEMENT

Last Inserted Record ID

The problem is that all the tuts I find on hits do the insert and connection so differently I am lost!

My code so far:

Code:
Dim rsBOR, inBOR, insSQL, newID
Set inBOR = Server.CreateObject("ADODB.Connection")
Set rsBOR = Server.CreateObject("ADODB.Recordset")
inBOR.Open Application("strConn")
insSQL = "insert into Main (EventName, .., RegionID) values ('"& strEventName & "',..,'" & RegionID & "')"
inBOR.Execute insSQL
' Retrive the ID
newID = inBOR("EventID")
Response.Write "The Event has been added to the database"
inBOR.Close
But it just doesn't like it!

Any ideas on how I should go about this?

View Replies View Related

Last Inserted Record ID

I'm using mySQL and wanted to get the ID of the record that I have just inserted in to the table (sentmessages). There is a function in mySQL that appears to be able to perform this task but I am not having any luck in getting it to work.

Anybody else tried, successfully or not, to use this ? The function is called LAST_INSERT_ID() and I have tried to implement it as follows :

strLastID = objConn.Execute("SELECT LAST_INSERT_ID() FROM sentmessages") .

View Replies View Related

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

How To Get Last Inserted Record Value In SQL Server

I am using ASP and SQL server 2000.

I insert reocrd using Insert query.

I want to get value of last inserted record in ASP for SQL server.

How i can get it?

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

Show Details Of First Record

I have a list of requests that I'm displaying. The client wants to be able
to display the details of the FIRST request as the page loads.

Right now, as I loop through the recordset, I'm checking the querystring for
"rid", and if rid = "" then I do a response.redirect to the page adding the
rid value to the querystring from the recordset.

I'm thinking this is not very effecient, but I can't figure out anything
better.. anyone have a good solution to show the details of the first item
on the list?

View Replies View Related

How Can I Use ASP To Show The TOP 5 Record In The Database ?

how can i make that the page show only TOP 5 record in the database ?

View Replies View Related

Show Or Hide Record

Is there a way to tell my data table that lists my records
that if a record's entry contains "Is Down" to show it on the page but if it contains "Is Up" to hide it?

View Replies View Related

Show/Hide Record

As admin I need the option to Show/Hide any given record at any giving time from any given user's query. When a client calls up their info, I may have added additional data to the db but I may not want to grant them access to that data until a certain time or I may need to 'un-activate' the data but still keep the record in the db. An on/off switch per record.

View Replies View Related

Last Inserted Value

I have an oracle database that I am submitting a form to. In the database I have setup a trigger to insert a casenumber everytime a form is inserted into the database. After they submit the form I then want to display to them the casenumber so they can check the status later. My problem is returning the correct casenumber to the user. Currently I am returning the max value from the casnumber column, but I think that may cause problems.It is working right now and gives me the correct value, but will I run into problems if 2 people submit a form at the same time? If you don't think this will work, what would you suggest I do? Is there anyway to return the value from my trigger?

View Replies View Related

Just Inserted Row

Im using a ASP and MS Access 2000 database. What im trying to do is: I insert a row into a table, in that table is a field that auto increments. after I insert this row I want to immediately after that be able to retrieve the value of the column containing the auto increment and hold it in a variable so i can use it for other things.

can anyone help me with this? I have been messing around with SQl cursors but cant seem to get it to work right.

View Replies View Related

User Inserted

I have a form where people from around the world will enter their address. As you know, addresses from around the globe vary so darn much. I thought that instead of a form with text boxes for such things as city, zip, street 1, street 2, etc., I could use a text-area. That being said, if someone entered in an address in a text box such as this:

Joe User
121 E 209th
Euclid Ohio
44123
United States

Could I take that and on the insertion into a database insert a <br /> where appropriate?

View Replies View Related

Inserted Sql5

That error is this:

ADODB.Recordset error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/noticias/indexnot.asp, line 45

In line 45 I have this stretch of the complete code below.

RS5_Tema(Aux) = RS5("auxcategorias")

The problems in codigo had started later that I added this code more. Code:

View Replies View Related

Commas Getting Inserted Into Database

I don't know if anyone has encountered this before. I've written ASP code to insert, update and delete records from Access and SQL Server tables before but this is the first time I face this issue -

I have a form that inserts data into an Access table. For a few of the fields, commas are getting inserted into the table. If the field is left blank, there is a comma inserted. If we enter data in the field, the comma is appended to the field value (eg: smith, )

The only thing different that i'm doing here from what I've done before is I'm inserting a larger number of fields into the table - 117 fields!!

Do you think the insert statement hasn't been written correctly?

View Replies View Related

How To Retrive Just Inserted Data

When I insert a record into my database, I don't insert the ID field because it's an autonumber and I want the database to generate it right?

Here's my question: Is there a way to have the recordset return that ID, or some other way of getting it with out making another recordset to grab the ID of the record that I just inserted?

View Replies View Related

Letter Be Is Inserted Into Numbers

when I ourput data from Access, numbers bigger than 999 are shown with letter "B" inserted into the 4th position left to the coma. (in my w2k regional settings I have the decimal dot separator set to "." and digit group separater set to nothing. In Access the number are shown with "." as decimal separator, but for some reason ASP used "," instead)
Say, 3000,00 is shown as 3B 000,00 Why and how do I sort this out?

View Replies View Related

Inserted Records Cant Be Display Immediately

i have a problem with my asp code...when i run a query, i insert the results on a temporary table...everything works fine except when i try to load the result page, it doesnt not display the recordset...

i need to press F5 always so that the page will be refreshed to show all records in the table.. how can I retrieved all inserted records in the temporary table without reloading the page?? below is my result page... Code:

View Replies View Related

Leading Space Being Inserted Into Db Field?

I'm UPDATING a value into an Access text field from a page but I can't get it to do the UPDATE without adding a leading space to the value??

This is a problem because I have another page where a user can search the entries, but when they do a search by this particular criteria, it returns no entries (ie. Search good_bad by "Positive" returns no results, but Search good_bad by " Positive" will return the proper results).

The value is coming from a option select box. It seems to only be a problem doing an UPDATE using a value from a select box as I'm using the EXACT same code to do an INSERT where the value comes from an INPUT box and it inserts with no leading space?? Code:

View Replies View Related

1 Value 2 Fields Inserted On Form Update

Without writing a bible on what I'm trying to do I'll see if someone
can answer a quick question.

I have a form that the user writes a value in a test field. I need to
put a hidden value that will take the same number the user inputs and
insert it in a form.

Basically, I need ...

<input name="hdndkqty" type="hidden" id="hdndkqty" value = ??? />

the value of the hidden field to = <input name="num" type="text"
id="num2" />

View Replies View Related

0x80004005 Error, Cannot Add Or Change A Record Because A Related Record Is...

I'm getting this error message: Error Type:

Microsoft JET Database Engine (0x80004005)

You cannot add or change a record because a related record is required in table 'employees'. Code:

View Replies View Related

Date Problem (wrong Date Inserted When Updating)

sql = "UPDATE Marknad SET" _
& " Typ ='" & Typ & "'" _
& ", Modell ='" & Modell & "'" _
& ", Arsmodell ='" & Arsmodell & "'" _
& ", Beskrivning ='" & Beskrivning & "'" _
& ", Stad ='" & Stad & "'" _
& ", Prisidé ='" & Priside & "'" _
& ", Fornamn ='" & Fornamn & "'" _
& ", Efternamn ='" & Efternamn & "'" _
& ", Telefon ='" & Telefon & "'" _
& ", Epost ='" & Epost & "'" _
& ", Datum ='" & Datum & "'" _
& " WHERE (((Marknad.Annonsnr)=" & Request.QueryString("id") & "))"
DatabaseConnection.Execute sql

---

Above does work as I want it to do BUT it inserts 1/8/2006 instead of 8/1/2006 as it should!

The best thing would be to exclude the date from updating at all, but when taking away the line:

& ", Datum ='" & Datum & "'" _
It gives an error... how do I solve this?

I forgot, you might want to see this:
Datum = date

View Replies View Related

Insert Record Goto Last Record

I have an insert record form that posts fine to a db which automatically creates an ID how could I get the next page to do a preview using the ID just created by the DB to go to the right record?

View Replies View Related

Record Numbers Against Record Problem...

I have a .asp page which lists a date, then a bunch of record lines for data that falls within that date, then the next date and it's bunch of data record lines. e.g.

Ship Date: 04/06/04

Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx

Ship Date: 11/07/04

Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx

What I want is:

Ship Date: 04/06/04

1: Data xxxxxxxxxxxxxxxxxxxxx
2: Data xxxxxxxxxxxxxxxxxxxxx
3: Data xxxxxxxxxxxxxxxxxxxxx
4: Data xxxxxxxxxxxxxxxxxxxxx

Ship Date: 11/07/04

1: Data xxxxxxxxxxxxxxxxxxxxx
2: Data xxxxxxxxxxxxxxxxxxxxx
3: Data xxxxxxxxxxxxxxxxxxxxx

How can I get these numbers printed againsts the records ?

View Replies View Related

If Then Show

is there a tutorial around anywhere that tells you how to change images on the page when a user selects from a select box

View Replies View Related

Don't Show Everything

I have a database of songs listed as Title, Artist,Description, DiscNo and TrackNo with a seperate record in that format for each song.What I would like to do is search through them for the Description, show only the disc numbers in the results.

This I can do easily. Where I am lost is that I only want each individual disc number to show once. If I moveNext through the recordset, it shows the disc number 15 times per disc. Is there a filter I can add to limit this display?

View Replies View Related

Don't Want This To Show

Is there any way to input .asp code so that a specific element isn't show on a page? example: I don't want a menu on a specific product page, but I want it on all the others. Is there any code to input into a site wide includes file to implement this?

View Replies View Related

Show A Progress Bar

I have a ASP application which let user to download their reports in pdf format. I would like to show a progress bar, or change the mouse cursor to a hourglass while the user is waiting for the file. How to acomplish this? In the asp code, I use response.BinaryWrite to create the pdf file directly to the browser. How to detect when the file is ready?

View Replies View Related

Show Recordsets

I create a page which will show me all the Regions from the table "RegionTable" where I have no information (empty fields) in on of the fields RegionDescription or RegionRank.
It is to make my content managing easier. I do not want to see those records which contain all the necessary info (region description and rank).
I tried the following code, but it does not work

qry = "SELECT * FROM RegionTable WHERE RegionDescription="" AND RegionRank="" "

error message is:
([Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1)

View Replies View Related

Show Full Value

I have a query that displays values from a db.
The problem is that the value displays like this:
R 6.5
instead of like this:
R 6.50
How would I get it to show the full value?

View Replies View Related

Show The USERNAME

ok, well what I have been having some trouble with is to show the person character name like this:

Welcome, 'Username' <-- Here I want it to show the persons username from the database.

View Replies View Related

How Can I Have A % Or $ Show Up In An E-mail?

I am using a Cdonts e-mail script that e-mails the results of a form to my address. It currently displays the data like:

Amount: 12.00
Percent: 2.00

I need it to say:

Amount: $12.00
Percent: 2.00%

How can I get the $ and % symbols to be included in the e-mail template without getting a 500 error?

Here is what I have:

Body = Body & vbcrlf & "Amount: " & request.form("amount")
Body = Body & vbcrlf & "Percent: " & request.form("percent")

I've tried a few diffrent ways but here is one example:

Body = Body & vbcrlf & "Amount: $" & request.form("amount")
Body = Body & vbcrlf & "Percent: " & request.form("percent")%

I've tried using / before the symbols and "" but everything I've tried keeps coming up with a 500 error. How can I add these symbols to my template so they will show up in the e-mail?

View Replies View Related

Show First 100 Chars

I know we have this thread somewhere, but I can't seem
to find it now

I want to show the first 100 chars of a string, but
I don't want a word to be cut in half at the end, it must
show the whole word then and go a bit beyond 100 chars.

View Replies View Related







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