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?
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.
Both commas are added dynamically and can be trimmed on the fly. I tried using RTRIM(strSQL, ",") but this didn't work.I put the fields into an array and tried to add only commas to all but the last entry, but that also didn't work.
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") .
I need to create a string along the lines of "23,43,78,23" with no comma at the beginning or end of it. The data comes out of a table so i've created a loop to get the data and form the string :
StrRecip = "," & objRS("number") & StrRecip
This will give me something like : ",42,78,67,2,90"
Using ASP/VB I need to remove unwanted commas from the end of a field that will be use in an array. There are items in the field that are comma separated, so I don't want to remove them, just the end ones, could be anywhere up to 5 unwanted commas.
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'm importing data from a csv file but have the following problem.
It see any comma in a specific column as the end of the current column and move the rest of the values into the next column I.E Data from column 4 display as data from column 5.
I do know that it's comma delimited but would like to know if there's no way that I can distinguish between the commas in a column and the commas that indicate a new column.
Col1 Col2 Col3 Col4 Col5 Value Value Value Val,ue Value
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
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 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?
I would like to know if you can display only certain data into a field between commas or any other symbol without using the curshort feature. For example. I have the following.
Part, A3472, Desc: Controller: Price$ 45.00
I just need this out of it in a single form field.
A3472
I cannot use the cutshort feature because my part numbers are different lengths.
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?
how to check got how many commas in this string? how to check beside the commas is space or not space? if the words beside the commas is space, i wan to remove the space? if the words got commas, i have to remove the space.
having problems removing commas from my form input. Have a form that is bringing back text strings from users. when it gets put into CSV file, any commas the user has entered get moved onto new rows.
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" />
how to avoid an error when calling data to a text form field that contains inverted commas? When I enter "inverted commas" into a text field on a form and save to my Access database, after save the text field appears to be blank but when I look in the database it appears as entered. The problem is when the text field calls the field it doesn't show if the text is encased in inverted commas.
For instance, in my form field 'title' I enter: Big Title "Yeah" After saving the form, all that appears within the form field 'title' is: Big Title Yet the access database itself shows: Big Title "Yeah"
I have a string --> 7,8,9,10. This string may contain more or less than 4 numbers. I want to separate each number and run an sql query for each number.
I am having a problem with a site that I am developing - my aim is for it to validate as XHTML Strict however, I am running into a couple of problems validating it; in my Response.Write ASP script, I am not including " 's to define page element tags as they keep throwing up errors in the page. Code: