Inserting Records In Database
I 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
View Replies
ADVERTISEMENT
I'm trying to pull the last 5 records from my database.
<% j=5
rs.MoveLast
While ((j>0) AND (NOT rs_article.BOF))%>
''Execute HTML and data insertion here
<%rs_article.MovePrevious
j=j-1
Wend%>
Everytime I attempt to run this code, I recieve an HTTP 500- Internal Server Error. It tells me no more than that. I know that my connection settings are OK because when I move forward through the database (first five records), the code executes without error. And yes, my Cursor type is Dynamic.
Alternatively, I would also like to know how to add new recordset to the beginning of a database rather than the end.
View Replies
View Related
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?
View Replies
View Related
how 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
I have created an online database for a school project, and everything WAS going fine until today. I created the add record page and for some reason, whenever i try to add the records to the database THIS error message comes up: Code:
View Replies
View Related
I am working on a project, and now I am experiencing a problem to insert multiple records at a time. My form is designed so that a user can insert multiple input (in several text fields).
What is the best strategy to handle this? the number of fields are created randomly (I will use innerHTML in Javascript to present text field randomly on my form). I have tried to use google using the following keyword: "inserting multiple records using ASP", but the result page did not satisfy me.
View Replies
View Related
although it seems that the database is updated the data doesn't pass to the table...Just the autonumber is increasing in the database without insering the records (the other records remain blank...like submitting nothing).. Code:
View Replies
View Related
Im having a hared time with this, im trying to update multiple records in a database from a form.
The form display all records from a search query and then the user selects whether to post the record of put the record on hold (two fields in the database).
Now everywhere I have looked I only see examples which update the records by using counts but I could end up with any number of records. I thought that using a loop would be an idea to get passed this.
View Replies
View Related
Does anyone know how to upload or insert multiple records into a MS Database. I've been trying to figure this out all day with little success. It seems that their should be a way to upload a txt file or csv file and have all the records go into the dbase.
View Replies
View Related
i've created a page that displays a list of records with a checkbox next to each.
I'd like to give my users the option of selecting multiple checkboxes then clicking submit which will insert a new record for each of the checked option.
for example: Code:
View Replies
View Related
I want to insert records into a database using a loop. I've got a number of input fields named 1-50. I want to request each textfield and insert the data into a database table.
Whats the best way of doing this? I've tried a While... Wend loop but the loop seems to carry on.
View Replies
View Related
i have a page where all my company records are disaplayed, now two records fit per page, so what i want to try and do is place a page break and a title after every two records so when its printed it prints them two per page with a a title on everypage.
View Replies
View Related
When I submit the Application form, various records are inserted into 10 different tables. The master table is taking the correct ID number, but the rest of the tables are showing "0" as the ID. Can anyone throw a light on what could be going wrong ?
View Replies
View Related
I am having trouble getting records to insert and update properly. This is not a consistent problem. It is intermittent. The page will allow me to correctly update 2 or 3 times generally, however after that it will double up the data in the insert and update.
Here is the code I am using. Code:
View Replies
View Related
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" + "'")"
View Replies
View Related
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.
View Replies
View Related
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 Related
I 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 Related
I 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"))
View Replies
View Related
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? ....
View Replies
View Related
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 Related
Anyone there can help suggest to me where i can find out more about Inserting image into a database.
View Replies
View Related
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 Related
I 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.
View Replies
View Related
i 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:
View Replies
View Related
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 Related
My question is this: how do I get a value from a listbox to assign to a variable (elementary I know)? Code:
View Replies
View Related
I'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 ?
View Replies
View Related
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 Related
I 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: ....
View Replies
View Related
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.
View Replies
View Related
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:
View Replies
View Related
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: ....
View Replies
View Related