I am using Ms Access database and I have set 3 digits (e.g. 000) for an autonumber field of my table.Its working fine in Access and incrementing automatically like this (001, 002, 003 ...), but when I call the data on a web page using ASP its displaying these numbers like this (1, 2, 3, 4 ...) I dont understand why is it not displaying the numbers as it is in the table.
This is probably an easy answer, however my mind seems to have gone blank about scanning a barcode in, and taking the 1st 4 digits of the number and storing it into a session variable to be referenced later in this application. This session variable will then be checked against an ACCESS database to see if the product exists. I assume I use the LEN function? LEN(VariableName, 4)?
I saw in SPF an ASP code that was usable to hide the first digits of a credit card number and replace them by a "*". I'm really sorry to post such a thread, but I can't find it back. Does anyone have the link? I've tried to check it in the funky functions and sections like that. Maybe just missed it but well. tried to see many times.
when I calculate a Digits for example: 101.12 * 1.21 the resilt is 122.3552 This one should be 122.36 and if it is 122.3549 to be 122.35 How can I make this thing works?
I have an access database with a table called jobs with a field called 'jobnumber'. I have this set up with a format mask of "0000" so that "1" becomes "0001" etc. However when pulling this data out in Dreamweaver the formatting is lost.
Does anyone know how I can set this in Dreamweaver?
I am trying to convert the date in DD/MM/YYYY format so it is always displayed as 01/01/2004 instead of 1/1/2004.The script I am trying to embed this into has similar attributes to the Calendar on this site located at http://www.asp101.com/samples/calendar.asp.and the objects that require to be double digits are iCurrent and Month(dDate).
I am storing a datetime into SQL Server 2000 field in datetime format. For single-digit months and dates, it is leaving the 0 off, like this:
11/6/2003 1/5/2003
For reasons having to do with technical requirements, I need to have it put the 0 in when needed, and not do it when it already has 2 digits:
11/06/2003 01/05/2003
How can this be done? When I get the value of the date in the first place, it is using the Now() function. For some fields, I only need the date, not time, so I do a DateValue around the result of the Now. Is this solved with ASP? Or do I need to do something in SQL Server?
in my asp form i would like to have a field which can ONLY accept digits BUT can accept special characters as well such as: &,$$,##. i.e: if the user enters :
147hhh, or P44556HH or QSSPE$% ---> this will be invalid ##123,45SS---> this is invalid 125&125#10$---> this is valid 12456--> this is valid too
I currently am using a script which submits full state names to a payment processor. However, the payment processor only accepts 2 digit state names. Does anyone have a premade code for asp that converts state names into 2 digit ones.
example:
If statename = "New York" Then statename = "NY" End If
i have a form for users to enter their name password and e-mail,i am currently using javascript to check that all details have been filled,
if(myForm.fname.value=='') { alert("Plz enter a first name") return false }
This works if the field is left blank however if the user enters numbers(1,2) or spaces i.e.(" ") how do i deal with these,i also need to check that the e-mail contains "@" and "."
I've searched the net but I couldn't find any SQL code on how to insert an autonumber column into an access database and table. Can anyone include the code?
I'm creating a basic ASP guest book, keeping my guest book entries in a Microsoft Access database, and using ADO to access it. My problem is that I am using the autonumbered ID field to split my guestbook into pages of 10 entries. It works for the most part, but if I delete an entry, a gap is left in the records and I end up 9 entries instead of 10 on that page. Basically I need a better way of sorting this out - I thought of SELECTing all the records into an array first and then working from that, but I can't get array to be dynamic enough in VBscript
It just inserts a new record into the db. What we did was add an autonumber field to the db, but now it won't update.
We know why - because it needs a value for every category in the db - but we don't know how to code it so it will update the db correctly. So, if anyone could help me with the (????) line in the coding so it will correctly update, that would be perfect!
What is the best way of using an AutoNumber system on an SQL server?I've been used to using Microsoft DBs for my online apps and have now upgraded to using Microsoft SQL server.
I want to be able to insert a new record into the database not such a problem but I want each record to have a unique identity no eg. NewsID. I know that you can do a lookup of the MAX number on insertion but if two people are inserting at the same time this may cause problems with duplication.
I use (something like) following code to add new records to a database, but it doesn't work!!! I need to know the value of an AutoNumber-field when I add the record. Why doesn't it work and how can I make it work? I think it should be easy, but I can't figure it out! Code:
I have a page that does an insert into a table in an Access DB which has an autonumber primary key field. Following this insert I need to be able to get the ID that was generated. If I were using SQL Server I would simply return fetch @@IDENTITY from a stored procedure for example.
Does anyone here know of something similar I can use in Access to be able to get that ID? I tried just using a SELECT query with all the information I had just inserted but it comes up empty unless I put it in a separate request (i.e. redirect to a new page passing all the info through the querystring and then building the query on the redirect page...which is a huge pain and takes FOREVER to run.
I have a form that is filled out and put into an Access database. The id field is Autonumber.
What I would like to do is also insert this data (or some of it) either into another database or another table, but I would like the created AutoNumber to be a part of this data. Is there any way to get this number immediatly after insertion?
I'm trying to write the code for an autonumber to go in to a text field when the page is open. I had it working in access but of course it won't work in asp. The format has to be for example: PBC-1200.
I have an Access database that uses an autonumber for the primary key. I hv app. 110 items in the table, and yet when I add a new item, it autonumbers as 534097 or some ridiculously long number.
How can I get it to go back to a smaller number without removing/trashing existing ID fields?
I have a recordset with two three fields. One is an autonumber field called ID , one is a text field called Name and the last is a date/time field called DateEntered. How can I programatically determine the autonumber field ? Code:
OK, I realize this is a subject that almost every developer would encounter, so I understand the answer is probably out there somewhere. Suffice it to say that I have been looking, both in this forum and on google, found many SQL server answers, and one for Access, which I have tried with no success. See the following: Code:
sql = "INSERT into someTable(IntColumn) values (" & fakeValue & ") SELECT @@IDENTITY" set rs = conn.execute(sql) response.write "New ID was " & rs(0)
This results in a JET database error, Missing semicolon at end of SQL statement. I tried adding it after the close paren, after the select @@identity, and after both, with the same error.
Why won't this code work - the "id" fields are autonumbers
Code:
<select size="1" name="Agent" tabindex=""> <option value="Select">Select Owner</option> <% x = rs("id") Do While NOT rs2.eof y = rs2("id") Response.Write "<option value='" & rs2("id") & "'" If x = y Then Response.Write " Selected" End If Response.Write " >" & rs2("first") & " " & rs2("last") & "</option>" & vbCrlf rs2.MoveNext Loop %> </select>
I insert the question in the correct place which is related to the table 1 but when it come to insert the answer for that specific question id didn't work .. it always take the first question in the table Code: