I have a form that inserts a student's course choices into an Access db. The student can choose from 4 options in a day. From a drop down box that is populated from the db.
Each course has a field called count1, count2, count3 and count4 which are the class sizes for those sessions. When they choose a session, I have a bit of ASP that takes '1' away from the count.
However, I need to validate the form when it is submitted so that if course = 0 a message pops up to say the course in that session is full. At the moment, the drop down boxes are populated by SQL that says only show if count>0 but if a lot of students load the page at the same time they can all subscribe to it - so I am getting -4 in some sessions. I need to check whether the course in that option is full i.e. '0' when the form is validated and then for it to tell them that that particular session is full.
I'm trying to verify a request.form("blah") with a field (value) in a recordset taken from an Access Database. Basically what I'm trying to do is once this NUMBER is entered into the form object (textfield), check a database to see if this number has been used (i.e. in the database) and if so redirect them to an error page.
I thought this would be rtight, but doesn't seem to work
If rsTeddyCheck = Request.Form("PersonalID") then response.redirect ("Error.asp") Else process.asp End If
I am making this application where I basically ask for a password (It is not a login). After the button is clicked - the word in the textbox is compared to an entry in a database. If the word is the same then it sends it to link 1, else it sends it to link 2.
I have an access database with year designations for field names, such 2005 2004 2003 ... and data corresponding thereto. I can formulate a query in MSAccess and it works just fine. However, I am trying to create a web page that will create a database connection and use SQL to create a recordset(s) which I can then manipulate in vbScript.
The problem seems to be structuring a query that will work in vbScript. I have tried several combinations:
rs2.Open "SELECT 2005,2004,2003 FROM Table", conn, adOpenStatic, adLockOptimistic rs2.Open "SELECT '2005','2004','2003' FROM Table", conn, adOpenStatic, adLockOptimistic rs2.Open "SELECT "2005","2004","2003" FROM Table", conn, adOpenStatic, adLockOptimistic
but none of these will extract data.
I have also tried casting these numbers to strings in a string variable, but still no success.
Is there some naming convention I am violating by simply using year designations as field names or is there a problem with vbScript?
I pass a table name into my program dynamically. I could display the data by looping through the object.Fields for both the field name and the field data using object.GetRows. What I have not figured out is if there is a way to figure out from the Fields what type of field (ie. Numeric, Text) it is. Certainly I could check the actual data once it is read, but is there a way to figure out the field type without doing that? Perhaps an object property of a recordset that I am not familiar with?
I have an asp page that has a function that connects to an Access database. I am using Javascript. Is there any way to reference the field name in the database through a variable in a sql statement? Code:
what i am trying to do is when the database field is empty to not display the box (table) that is in my css file, whereas when there's something in the field i would like the box to display!!! So i'm basically trying to get a 'when field empy, do nothing!!! my code at present generates the box no matter whether the field is full or not!!! Code:
I'm having a spot of trouble trying to update fields in a access database using asp. I can delete and add fields thru the asp page but when i attempt to modify the fields i get a page not found error message. Code:
I want to search 2 of my database fields (title and description) for search terms entered in a form. I can do a 'LIKE' but how do I cover searching for each word in the string that has been submitted? For example, if someone searches for 'World Cup Final', I want to search both database fields for 'world', 'cup' and 'final'.
If IRNvar(0,num) = "True" then IRNvar(0,num) = 1 else IRNvar(0,num) = 0 end if
In my sql database I have a True/False field called VariantFlag which is a bit data type. The IRNvar value is numeric. I am trying to insert the 1 or 0 into the database so that the field shows true or false accordingly but I get a 'Type Mismatch' error. Here's the insert statement:
I need to validate an item number from a form field against a MS SQL database
I am using a 2 page process to print barcodes from an entered item number on page 1 and need to only use valid item numbers from the database. If they enter a wrong number I want to give them a page telling them of the error.
I have 32 fields on page 1 to enter 32 items.(one for every label on the second page that contains the barcodes. Here is the connection to the database that I am using for the barcode.(Column IMLITM contains the item numbers) Code:
I currently have a web page that pulls in job vacancies from a search form all written in asp and the database is in access. I will be placing an extra field which will say "apply now" and on selecting this you will be taken to a new page where you can fill in your details and email them to the employer.
My problem is I need to know how to get a field in the form that will automatically fill in the title of the vacancy being applied for from the database.
I am pulling legislation information and expiry dates from an access database and posting to the web. The expiry dates in access are formatted as Month Day, Year (EG.. January 1, 2006) But when they are pulled from the database to the web, they come out as 01/01/06. I know that the format we have in access is simply a mask, however we require that format be carried through.
This is likely a simple solution, however I am new to ASP and can't seem to locate any information on this. I have searched the forum for related info on this but can't find anything that relates to my specific situation.
Here's the code we are using so far...
Code:
<% Do While NOT Recordset.Eof 'i.e. carry on looping through while there are records Response.write "<tr><td>"'open row and first cell Response.write Recordset("Legislation") Response.write "</td>"'close first cell Response.write "<td>"'open second cell Response.write Recordset("Repealed") Response.write " " Response.write Recordset("Expiry_Date") Response.write "</td></tr>" 'close row Recordset.MoveNext 'move on to the next record Loop %>
I have also found and implemented the following code:
How to search a database field from form input? is it easy to do i like to have a html form from an html page that will call an asp page to do db search, if user enter a zipcode that match in the database it will pull all the infomation from both talbes and display on the screen
i have 2 tables related to each other contact table id, fname, lastname, contactid, email
How to search a database field from form input? is it easy to do i like to have a html form from an html page that will call an asp page to do db search, if user enter a zipcode that match in the database it will pull all the infomation from both talbes and display on the screen
I would like to create a page of hyperlinks that are constructed from the contents of a database field. When the user clicks the link they are taken to a page that will display all fields from that particular record.
I already have the page structures in place. There are two pages, one with the links and the other to display the record. Code:
I am using an Access database, and for a field called size the client entered some values such as 20" x 20" Unfortunately when I try to print that field to the page, the cursor stops typing at 20 because I'm assuming it considers the first " inside the 20" x 20" to be the end of the string.
I am simply trying to print the whole string <%=(rsProdsUpdate("size1"))%>
Is there a workaround this without having to change all the values in the database?
I'm making a page that adds form data to an access database. When I press send, I get this error:
"Microsoft JET Database Engineerror '80040e57'
The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data."Is there any way of making the form field bigger?
vMessageText = "This is a test just to see if it will blow up on a large comment. Just testing again. Don't mind me."
Can I put this into my database field or is it too much and if not, how do I solve this issue. I need to be able to post messages and input for large fields.