Updating A Field In A Record
I try to execute the following:
Dim rsCars,mySQL,CAR_ID1,CAR_NAME
set rsCars=Server.CreateObject("ADODB.Recordset")
mySQL="select * from CAR WHERE (ENDING_DATE < Now() AND MAIL_SENT=0) AND CAR_STATUS=0;"
'mySQL="Update CAR SET MAIL_SENT=1 WHERE (ENDING_DATE < Now() AND MAIL_SENT=0) AND CAR_STATUS=0;"
rsCars.CursorType = 2
rsCars.LockType = 3
rsCars.Open mySQL,objConn
'set rsCars = objConn.Execute(mySQL)
But, it doesn't work both ways , and gives the following error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
View Replies
ADVERTISEMENT
I have a bit of ASP that gets data from the database and then displays it. This part works fine.
I then have anouther page to allow for changing this information, then i want to do two things, first show the updated info, and then update it in the database.
Neither of my updates will work and i can't figure out why.
I get this error: ADODB.Recordset error '800a0cb3'
Object or provider is not capable of performing requested operation.
I have checked the record it displays the info just fine, it will not update however. Here is my code for updating the record: Code:
View Replies
View Related
I have a form which displays a record from a database. The user can amend the form as they wish before finally pressing the update button. When I get to the page which does the updating, I am unable to access the form elements. I read on one post that you can't do this using the request command but you can achieve it using the Upload component?
Suppose my form has the following 2 fields:
- brideName
- groomName
My SQL that gets the record is as follows:
Select * From Users WHERE Username='" & User & "'"
How do I update the fields bride and groom in my database using the above form fields?
View Replies
View Related
Im trying to update a record in my database by using a form which the user will enter the name of the rep and then the form will update the database inserting the rep. My script seems to look ok and doesnt error at any point but when it goes to update it doesnt actually update anything in my database. Could somebody please take a look.
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
View Replies
View Related
What I am trying to do is upload a file and rename it - this part works Then, get the record and update the file name field with the strName - this part does not work Here is the uploading script: Code:
View Replies
View Related
i have listing.asp to list all the records in both tables .i want to create a hyperlink to to update.asp in which this will update any fields that changed but i was able to update first table but having problem updating the second one. how can i update the second one as well . i have the same problem with delete too.
View Replies
View Related
My question is regarding updating records. I'm using Dreamweaver MX and a MSSQL database (using an OLE DB connection) and whenever I try to update a record, I only get record #1 to update. It doesn't matter whether I select record # 4 or 15, I can only update the first record. I followed this tutorial line by line so I'm not sure why it's doing this.
View Replies
View Related
I am dynamically building a query from an access db to output on a separate page. This is working fine.
On this page (the query results page), I want to have checkboxes and a text field where the user can input text and select the records to update (by checking the box). Once they select and hit submit, I want to update only the records selected.
Problem is, I am trying to figure out the most efficient way of doing this...any ideas?
View Replies
View Related
I have a very simple Access database with these fields:
ID | Team | Score
I want a user to enter the new score of the team into a form and then it's updated. All pretty straighforward - except I'm getting an error at the bottom of this page:
ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/forensic/update.asp, line 171
And when I submit the page I get this error:
View Replies
View Related
I am trying to write some code that inserts or updates a text field in my SQL Server 2000 database. The SQL statement is created using a submit from a form, and the text is coming from a <textarea>, and therefore being placed into the SQL statement via a Request("field"). However, due to limitations in SQL Server 2000 and text fields, I can not use a simple Update or Insert command with text over 8000 bytes.
Does anybody have any sample statements that will help me update that field with larger amounts of data? I have tried using the WRITETEXT function and UPDATETEXT function with little or no success.
View Replies
View Related
How would I change the following update statement so that if one of the AreaCode fields was blank, that it passes instead of saying Syntax error in UPDATE statement?
Quote:
sqlString = "UPDATE Installers SET Company='" & Request.Form("company1") & "', [Contact]='" & Request.Form("contact") & "', Phone='" & Request.Form("phone") & "', Fax='" & Request.Form("fax") & "', Email='" & Request.Form("email") & "', Website='" & Request.Form("website") & "', Address='" & Request.Form("address") & "', City='" & Request.Form("city") & "', State='" & Request.Form("state") & "', ZipCode='" & Request.Form("zipcode") & "', Country='" & Request.Form("country") & "', AreaCode=" & Request.Form("areacode1") & ", AreaCode2=" & Request.Form("areacode2") & ", AreaCode3=" & Request.Form("areacode3") & ", AreaCode4=" & Request.Form("areacode4") & ", AreaCode5=" & Request.Form("areacode5") & ", AreaCode6=" & Request.Form("areacode6") & ", AreaCode7=" & Request.Form("areacode7") & " WHERE Company='" & Request.Form("company") & "'"
View Replies
View Related
In a form I have one pulldown menu, and one text field. Both MUST get their values from an Access database they connect to. Without submitting the form, how do I change the value appearing in the text field by changing the selection in the pulldown menu? Remember both the text field and the pulldown menu MUST get their values from a database.
View Replies
View Related
I'm trying to update time field which MSACCESS using query
Sql2 = "Update tblExtraNetUsers SET Lo_date = " & Date()
& ",Lo_time =#" & FormatDateTime(Time(),4) &"# ,Lo_count
= " & rs("Lo_count") + 1 & " WHERE UserLogOn = 'david'"
But its always gives a error message . Operation must use an updateable query.
View Replies
View Related
What i am trying to do is Update data in a table with data in another table but i want to update 2 fields in the destination table with data from 1 field in another table.
These are the table i have and their fields:
*CUPFirstRound* - Table1
GameId
GameDate
Home
Away
HomeScore
AwayScore
Winner
There are 8 rows in this table, thereofre the GameID's go from 1 to 8 Code:
View Replies
View Related
Say I have a field containig some text, for example: The quick brown fox jumped over the fence. How do I only show the first 4 words of the sentance, i.e: The quick brown fox...
View Replies
View Related
i'm trying to figure out why i can not update a record if in the text box there is a ' anywhere in the field..
View Replies
View Related
I'm trying to delete some record information but only a set number of fields. when i run the following, it deletes all the record and not the field information in the given records:
set rs = server.CreateObject ("adodb.recordset")
StrSql = "DELETE field4, field5, field6," _
& " field7, field8, field9" _
& " FROM tblStock" _
& " WHERE field1 ='" & Request("loc") & "'" _
& " AND field2 ='" & Request("pdt") & "'" _
& " AND NumberOut =" & Request(" numberout")
'DEBUG ONLY
'Response.Write StrSql & "<br>"
'Response.End
cn.Execute StrSql
View Replies
View Related
How would I get the max record + 1 to auto-populate in the GMVINC form field? I have a feeling that my query is not correct. Code:
View Replies
View Related
I'm getting this error message: Error Type:
Microsoft JET Database Engine (0x80004005)
You cannot add or change a record because a related record is required in table 'employees'. Code:
View Replies
View Related
I have an insert record form that posts fine to a db which automatically creates an ID how could I get the next page to do a preview using the ID just created by the DB to go to the right record?
View Replies
View Related
I have a .asp page which lists a date, then a bunch of record lines for data that falls within that date, then the next date and it's bunch of data record lines. e.g.
Ship Date: 04/06/04
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Ship Date: 11/07/04
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
Data xxxxxxxxxxxxxxxxxxxxx
What I want is:
Ship Date: 04/06/04
1: Data xxxxxxxxxxxxxxxxxxxxx
2: Data xxxxxxxxxxxxxxxxxxxxx
3: Data xxxxxxxxxxxxxxxxxxxxx
4: Data xxxxxxxxxxxxxxxxxxxxx
Ship Date: 11/07/04
1: Data xxxxxxxxxxxxxxxxxxxxx
2: Data xxxxxxxxxxxxxxxxxxxxx
3: Data xxxxxxxxxxxxxxxxxxxxx
How can I get these numbers printed againsts the records ?
View Replies
View Related
I am using a Relational database for my site and i have the following tables:
FIXTURES, GAMEDATES
the fields in FIXTURES are:
GameDate
Home
Away
(All of the above are numerical fields)
the fields in GAMEDATES are:
DateID(integer)
GameDate(#Date Field#)
What i have done is in the GAMEDATE field in the FIXTURES table i have used the ID number of the date that i wish to assign to that record - using a LEFT JOIN to display the actual date that is pulled from the GAMEDATES table (That which corresponds to the relevant id used in Fixtures)
The problem is that in some of my code i want to display records using sql and sometimes in the where clause i use the following:
WHERE Fixtures.GameDate<=(Date())
obviously meaning WHERE GAMEDATE is LESS THAN or EQUAL to TODAY.
The thing is when i use the join it does not use the where clause and displays all of the records in the FIXTURES table.
Does any one know how to get around this, i have not received any error messages it just isnt displaying the right data
View Replies
View Related
Im comparing values in a field while doing a loop if sAct<>myData(5,i) then At the end of the loop I make the value of sAct equal the current myData
This will work when comparing other fields withing my recordset (so I know the statement works) but it will not work for the field I want to compare. The only difference with this field is that it has null values. Could this be the problem? if so, how do I deal with nulls?
View Replies
View Related
I have a input form with 5 fields. One of the fields is MajorNo and the other is named Description.
I have a reference table in my MS Access database (tblMajor)that lists the major numbers and their descriptions.
I would like to have the description field in my ASP automatically filled based on the major number entered on the form, so the user will only need to input the major number when submitting to the Access table (tblSalesTotal).
View Replies
View Related
I am trying to pass a hidden field value on a form into another field on the
form so that it can then be inserted in the database, to enable me then to
reference that number at a later date.
(The hidden value (1 for example) would then automatically get passed to the
other input field.)
The code for the text field that allows users to type an number into it for
submission to the db is below, but what code do i need within the hidden
field to populate this text field below so that users do not have to type the
number in? Code:
View Replies
View Related
I have being working with making an edit field over the past few days. The edit function is now working fine. The edit fields that i have are for id, subject, notes, timedate.
All of the edit screens are one line text screens. What I want to do now is increase the size of the notes box to a larger textarea type box to make it easier to edit notes. The notes field in the db is a textarea field. Code:
View Replies
View Related
Well, my script consists in check if the typed code doesn't exist in the DATABASE, but thats not the problem... the problem is that the PAGE1.ASP (that check the code) redirects to the ADD.ASP that will add those codes to the database!
Response.Redirect("add.asp?cod_1=" + cod_1 + "&cod_2=" + cod_2 + "&cod_3=" + cod_3 + "&cod_4=" + cod_4 + "&cod_5=" + cod_5 + "&sexo1=" + sexo1 + "&sexo2=" + sexo2 + "&sexo3=" + sexo3 + "&sexo4=" + sexo4 + "&sexo5=" + sexo5)
That's the line in page1.asp that redirects to the add.asp. So, when the database is completed empty and, the page1.asp checks that there ins't any problem with it and redirect to the add.asp that doesn't update my database!! So, it continues without any record. But, if the database has, at least, one record, the script works normally without any problem!
Another thing that I noticed is that when I, manually, type the adress Http://127.0.0.1/add.asp?cod_1=176096, for example, and the the database is empty, the script does the UPDATE and adds the code to the table!
I have no idea that the problem is. Does any one have a clue?
The goes the add.asp script: ....
View Replies
View Related
I'm not sure if this is an ASP thing, a IIS thing, or a GoDaddy (where my domain is registerd and forwarded from) thing...
First I'll start by saying I run my own Windows XP web server and do all the coding myself..
I've noticed in the past (and never really gave it much thought, because the site works fine), that when I switch pages within my site, that the URL line is not always updated.
For example, I go into the pictures section, view a few pictures, then select the "Home" tab... The URL will stay with the variables that were passed when I was viewing the pictures. Therefore, if I do a "refresh", the page goes back to the pictures I was previously looking at, not the home page.
I've tried this on multiple computers at multiple sites, and with multiple browsers... And seems to happen rather consistantly...
Anyone have any thoughts?
View Replies
View Related
I am looking at updating a notes part of my data base. I am calling two fields (first name and last) from the data base and putting them into read only text box (as i dont want the details changing). All of this is contained within a form. I am also calling a feild from the database called notes which originally has been inserted using a <textarea> tag. The problem i face is that you cant put values into a <textarea> (ie. i can put data from the database into the value tag of a textbox but <textarea> doesn't have a value tag). Due to this i am putting existing notes onto the page as text. Under this i have do have a <textarea> to put the new notes in.
The problem i have is that i some how need to store the existing data in the notes field and then add it to the new notes that i will be adding. I just don't know how to put the data i am getting from the notes field in the database into a variable.
View Replies
View Related
Having problems writing an update script because in one of my fields I'm adding a chunk of HTML that contains ' characters. Obviously this throws up an error. How do I get around this?
View Replies
View Related
I'm trying to create and assign variables with the values from my db but can't work out the code getting my " & ' mixed up.
i = 1
do until i = 6 or rsSet.EOF
rBlock(i) = rsSet("rBlock'" & (i) & "'")
i= i + 1
rsSet.MoveNext
loop
View Replies
View Related
whats better ADO or SQL
for example, an INSERT statement or an objrecordset.update blah blah?
same with .net
should I C# to update or SQL
View Replies
View Related
I have an XML file which i'm trying to append elements to using an html form and ASP with javascript scripting inside the ASP file. Code:
View Replies
View Related