Inserting Value From List Box Into Database Field
My question is this: how do I get a value from a listbox to assign to a variable (elementary I know)? Code:
View RepliesMy question is this: how do I get a value from a listbox to assign to a variable (elementary I know)? Code:
View RepliesI have an ASP variable called IRNvar:
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:
SQL = "INSERT INTO Documents (CNID, DocumentPrefix, DocCategory, DocumentName, VariantFlag, PartNo, PartDesc, NewIssue, StatusID) VALUES ('" & CNID & "', '" & IRNprefix & "', '" & IRNcat & "', '" & IRNnumber & "', " & IRNvar & ", '" & PartNum & "', '" & IRNDesc(0,num) & "', 'A', '5')"
Is there a way to convert the number to the right data type? Am I doing something wrong? I'm quite new to all this so it's probably something silly.
I have been provided with a DSN, user name and password for one of my
clients sites.
I'm not an ASP developer and need to view all the contents of this database.
I usually work in PHP but only have ASP available on this server.
I want to open the database and simply output all the contents into a HTML
page.
I have an .asp page that contains a drop down menu, that when a selection is made, reformats the page to one of 22 different .asp pages. When clicked, the drop-down disappears and the options from it are formatted as a list on the left hand side of the page.
I need to format this so the list is in 3 columns, with the secection bold. I think I need about 4 if..then statements, but I've never done this before...here's the specific code, the code for the drop-down is first, then the code for the "quick link" list: Code:
How can I insert a new field in a MS Access database table. I've already got the following but I can't get it to work with a default value. Quote:
ALTER TABLE Articles ADD 'Moderated' number
How do I add a default value?
I have a field couponID as the primary key in my table - when writing the insert statement how do I get the autonumber value to be inserted? below is the code that I have, but it doesn't work
sql="INSERT INTO coupon (Value, ValueSecondLine, ValidThrough)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("value") & "',"
sql=sql & "'" & Request.Form("validSecondLine") & "',"
sql=sql & "'" & Request.Form("validThrough") & "')"
conn.Execute sql
I have a text field in a web page I am working on that seems to be calculating phone numbers before inserting them into an Access database. i.e., 867-5309 will result as -4442 in the Access text field. My guess is that the webserver or client is processing it before inserting it. Is there any way to stop this other than using a validation script?
View Replies View RelatedI have a page that has a form on it which has a dropdown list on it. It connect to an sql database and populate the list. What I would like to do is make the list editable so that if the data returned doesnt contain what I want, I can type in the data I require which will then be updated to the database when the form is posted. Hope I've made sense, you may be able to tell.
View Replies View Relatedi have field company_name and what im trying to do is
A
Abrahams Company Alexs company AZ''x Company
Adams company Adrians Company
B
Bills company
Bobs Compay
I want the names spread over 3 columns and by alphebet category. can yous ee by the example what i mean? and is this easy to achieve?
What I would like to happen on this page is that when a user selects a company name from a drop down list, his selection autopopulates the cID field based on the selection. The drop down list is getting its choices from the customer table.
As I am still a novice, I am sure there is a way to do it I have not been able to get it right. Code:
I have a survey/member form that gathers information. I would like to have a drop down list on a page that a user selects, either 1, 2 or 3.If 2 or 3 I would like to show on the form another field for information gathering ie:if a user has 1 cat, fields for cat name, sex & age show.
if a user has 2 cats, 2 fields show instead of one for each, and the same
for 3.....
I had some Error when i write the update sqlp query
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/fyp/Quiz/updateQuiz.asp, line 21, column 77
SQL_query= "update Activity_Status set UserID = '" +Request.Form("username") "'" "where Score = '" +Request.Form("QuizScore" + "'")"
Code:
SQL_query= "update Activity_Status set UserID = '" +Request.Form("username") "'" "where Score = '" +Request.Form("QuizScore" + "'")"
I have the folllowing page where a user can add a review to the website. So far the page works fine, but on the review rating section I know that the rating is between 0 - 5.
But its posible for a user to enter 1000 if they wished, which still means the page works but the answer is too high.
Also if they write text in the field it errors the page. How do i code this so that they can only enter a number between 0 and 5 and only a number and not text.
I have a problem with inserting the results of which radio button was selected into a database. I have the code for the text fields down with no problems. I guess my question is how to populate the yes/no fields in the access database.
View Replies View RelatedI am having trouble with someone else's code that worked when it was used last, but now it's not. I am new to ASP programming so I not too sure what's happening. Code:
View Replies View RelatedI have a table in access that contains to primary keys, they are both defined as numbers and I want to insert data into them in ASP:
I've tried a couple of statements as follows:
strADDIDQuery = "INSERT INTO [Jnct LP Obj] (LessonPlanID, ObjectivesID)VALUES " & strLessonPlanID , & strObjID
This tells me that an end of statement is expected:
and this:
strADDIDQuery = "INSERT INTO [Jnct LP Obj] (LessonPlanID, ObjectivesID)VALUES " & strLessonPlanID & "','" & strObjID & "')"
just doesn't work (page cannot be displayed)I'm sure it's a sytnax problem, something to do with integers? but I've searched loads of sites and can't find any that are using simliar code:
The values are pulled from a form as follows:
strLessonPlanID = cInt(request.Form("LPID"))
strObjID = cInt(request.Form("OBJID"))
what the best way to update a ms access database from an asp page is.I have a db with 3 different tables,these tables are bound to each other via the relationships.
On my asp page,I want to create one page where the user would enter in information and hit submit.The problem I have though is that how do I have only one button that will update information from 3 or more tables all at once?
I have a page setup where a user can login and add news to a site.
I had to write a small function to eliminate any apostrophies or dashes in the SQL insert statemnet to prevent any errors or confusion.
My question is, is there an easier way to do this? ....
I have simple form that sends data to an access database. The action is listed below. Am i missing a connector somewhere? Code:
View Replies View RelatedAnyone there can help suggest to me where i can find out more about Inserting image into a database.
View Replies View RelatedI want to insert multiple records in my SQL database. I was wondering if this is the right way to do it: PHP Code:
set insertRecords = Server.CreateObject("ADODB.Recordset")
insertRecords.ActiveConnection = mlConn
For i = 0 To 5
insertRecords.Source = "INSERT INTO Info (Name, Age) VALUES (" & getName & ", 20)"
insertRecords.Open()
Next
I am currently developing a coursework for uni that involves inserting some values into a Access database. I know how to do this, however I am trying to use different insert statements to insert data into different tables, however all the input field are on the same page. Code:
View Replies View Relatedi am trying to use the 'Insert into' sql query to insert data in an asp file but having some errors...this is the eror i got from the browser..
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/AddConfirm.asp, line 46, column 36
sql="INSERT INTO tblMembers VALUES("8"," & DateJoined & "",""& Title& "",""& LastName& "",""&FirstName& "",""& DOB & "",""& AddressUnit&"""
this is the code i have in my asp file....
Code:
I have a ASP/vbscript program that generates random passwords. The problem is I need to insert those passwords into an Access database of 327 clients. I have the random password program generating the 327 passwords, but have had no luck inserting them. Code:
View Replies View RelatedI'm trying to put some text into the database using ADODB.Command object. Seems like a reasonable thing to do and I can do it. But in this instance my text is an HTML code which contains many quotes. But i have to save it as is into the database field.
I use:
INSERT INTO (f1, f2) VALUES (v1, v2) comand. But since my v2 contains some quotes in it, (many quotes), I get an error. (it works otherwise). Is there any way ?
I would like to know if there are any tutorials out there or websites that can explain more about this? can this be done in asp?
View Replies View RelatedI am struggling to store an image path to a mysql database and in the process copy the image from one folder to the folder I would like it to be copied to.
My code for the inserting the image path and data into the mysql db is below: ....
I made a 2 web surveys with identical code. Although the code is similar in both, values on the last page of one of the survey do not go in the database.
I have tried playing around (coz I really dont understand what the problem is), but nothing works. The same code works on the other survey with absolutely no problems.All thats there in my survey to insert values is
.Fields ("fieldname") = Request.value ("name of text box")
.update
Any suggestions? If someones willing to help me out quick, I will post my code.
I am trying to insert data from a form into a database and i am getting the following error:
Microsoft JET Database Engine error '80004005'
Operation must use an updateable query.
The code that i used can be seen below: Code:
I am trying to save arabic data from asp and it's not being saved with right encoding. i tried with both code pages 1252 and 1256. each time i am getting different set of characters in db, but not as i am entering in asp page.
when i retrieve arabic data from database and display in web pages it's showing correct text.
i am using following code in asp side: ....
if it is possible to insert and update records in a database from the data that is in an HTML table? I have a program that converts data to an HTML table and would like to be able to insert/update records to the database on the webserver.
View Replies View RelatedDoes anyone know how I can insert daynamic text box data into a SQL Server database? I have text boxes that are being generated dynamically and I want each of those values inserted into the database that hold the results. I'm not sure how to write my loop statement.
View Replies View Relatedhow to do a dnsless connection to an access database and then insert records. The database name is members and table name is member_info.
View Replies View Related