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?
i am designing a database using Ms Access and ASP. i have 3 tables in access namely 'PERSONAL', other as 'POLICY' and 3rd one is named as 'STAFF'. in the contact table i have ID, Name, Children as fields. Also in policy table the firlds are:- ID, date_of_policy, no_policy, amount_paid, amount_balance and similarly the 3rd ie., staff has few fields. all three are linked my a common field which is ID
all i want is when the user searches for a perticular name (from frontend) it should search through table- 'PERSONAL' (fields- Name and Children). once it get the perticular name with the help of the ID it should retrive the datafrom both 'POLICY' and 'STAFF' of that perticular Name.
i do know how to search and retrive data from the same table but got a bit confused on how to retrive data from different tables using the 'PERSONAL' table just for reference and linking to the other 2 tables.
I have multiple list box added to the asp page using <select> tag I have added items in the list box using recrdset from Education table Education table={educationid, educationname} User can choose more than items from the list box. These items gets added in the user table in field "edu" seprated by commas. When User wants to edit his information ...i want that the items in the list box should be automatically selected which are present in "edu" field.
I have retrive values (e.g name )from data base (access) in Combo Box. and further what i want to do is. when i select a particular name from Combo box. at that time Comments an other field in data base related to this Name should be display in Text Box.
i creating a page allowing the user to edit and update their personal information. i have a field call gender which consists of 2 radio button which value is male and female. i save the value in the database. now the problem is how can i retrieve back the value which in radio button form showing which has been selected?
I have multiple list box added to the asp page using <select> tag. I have added items in the list box using recrdset from Education table Education table={educationid, educationname}
User can choose more than items from the list box. These items gets added in the user table in field "edu" seprated by commas. When User wants to edit his information ...i want that the items in the list box should be automatically selected which are present in "edu" field.
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?
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.
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?
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!
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") .
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?
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?
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
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?
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?
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:
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:
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" />
I'm using DW MX 2004 to build an asp based eStore. I have a checkout page created with both the billing and shipping information in the same form. I'd like to add some code and a button to activate it to copy the code to the shipping info (but it can't submit form). Also the State choice is a drop down list based on a recordset. There are other behaviors attached.
Dreamweaver created code to update to data base. But when testing on website i get the following message. I have no clue what it might be. Microsoft JET Database Engine error '80040e14' Syntax error in UPDATE statement. /admin/update.asp, line 111 line 11 is strName.execute I read it might be forbiden characters in the data base field names or spaces... but i don't have that. the names are userName, userLevel, ID, Password.
This seems a very complicated task, so I welcome any input. My boss wants a data grid or matrix of the top 6 orders with ordered items, and products, for a particular customer and he wants to see it like this:
products down the left side orders across the top number of items under the respective order number column across from the corresponding product.
I hope that makes sense. I have three tables. Products, Orders, Orderitems. I don't even know where to start. Many thanks in advance for any input offered.
how do i get data from a user on one page and display the result on the other page actually i have written a prgoram that displays a set of checkboxes and based on the checkboxes selected the related data is displayed .but the problem is the data is displayed on the same page below the list of check boxes. Code:
I have a form that has the option to upload a file at the bottom. If you select a file it works fine but if you leave file selection blank the forms bombs. This is not how I want it to work. On the form you need to use ENCTYPE="multipart/form-data" in the form tag.
On the processing page I need to use Set to assign a variable to the form data. I tried using IF on the variable assigned to the file path but it bombs out telling me "This function is not supported". Is there any other way I can check to see if curQes has a value assigned to it?
How can I display data from an XML file in ASP?I want to use an XML file instead of an Access or SQL database and would like to display this information the same as I would if I were using Access or SQL as the datasource.