MySql Field Update

Why is it that this does not work in MySql?

RS.Fields("Fullname").value = "Bob"

Is it because MySql does not support this?

The code below is a bit more representative of what I'm doing:

<!--#INCLUDE FILE="Database_Open.asp"-->
<%
sql ="SELECT * FROM CustomerBase WHERE " & _
"UserName='" & username & "' AND " & _
"SECRETWORD='" & password & "' "

RS.Open Sql, Connection, 3

IF RS.EOF THEN
'redirect code here
ELSE
RS.Fields("Fullname").value = "Bob"
RS.Update
%><!--#INCLUDE FILE="Database_Close.asp"--><%
Response.Redirect ("Menu_Account.asp")
END IF
%>

View Replies


ADVERTISEMENT

Update Record In MYSQL

ASP VB. I have 1 recordset where I pull the order in.
I have another that I pull in the on-hand qty.
I used a repeat region and now I have it working to display the new on-hand qty. Now I just need to update the recordset with the qty on hand.

View Replies View Related

Update MySQL Problem

I've always sticked to MS SQL Server because it doesnt give me troubles that I have with MySQL. But decided to give it another shot.

I use "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=myserver; DATABASE=mybase; UID=myid;PASSWORD=mypwd; OPTION=3" connstring to connect to my database online.

I can read and get records off the database easily, but everytime I try to update records using recordset

rs. open "SELECT * FROM MyTable", Conn, 3, 3
rs("Content")="Hello" 'text datatypers.update

It always generates error. Can some1 help me with this?

View Replies View Related

UPDATE Mysql Record From Within <A HREF...>

I have a .asp page that displays an HTML page: view_msg.asp

There is a link (anchor tag) on that page that when clicked, sends the user to another page. I would like to also execute a MySQL query when that link is clicked. The DB is already open and connected to the page. The current current tag looks like this:

<a href="view_messages.asp"><IMG SRC="example.gif"></a>

and the MySql command I want to send is:
UPDATE Messages SET `fromDisplay`="N" WHERE idMessage=" & idMsg "

In english: When someone clicks on the link I want to execute a MySQL command to set the field value to N... how do I do that?

I know this is a very rookie question - but I don't know enough about asp to know how to execute the command here the way I want. Do I have to turn the image/button into a <FORM> 'submit' button</FORM> and use a redirect? Or, would I use an ONLCKICK. What would the correct syntax be?

View Replies View Related

ASP - Date Formating MySql Insert/update

I am storing dates in a mySql database in the format yyyy-mm-dd. Now, I have set up so that this field is insert by a form.

It isn't very user friendly to have to type yyyy-mm-dd, how can I set up so that the user can enter format dd/mm/yyyy and it will automatically insert into the database as yyyy-mm-dd? I am using Dreamweaver MX 2004 and ASP.

View Replies View Related

Mysql Float Field

in mysql i have a float field for bonus points, wich work as currency.
ie 5.12 bonus points = 5.12 discount
i have had the value of 5.12 in the points, and then used 5.12 bonuspoints
however when it has been taken away i am left with this:

-1.14441e-007

as the value in bonuspoints
here is mysql

"UPDATE customers SET bonusPoints=bonusPoints-" &pBonusPoints

really i think it should be 0

View Replies View Related

ASP/Mysql Empty Text Field Query Error

I'm getting an error when I'm retreaving from a "text field" in the database and it has no data in it. I'm using MYSQL version 3.23.58-nt. I have the same script running a different system and I don't get this error. It justs output nothing and continues with the loop.

This has to be an ASP problem when retrieving data from the database. I've change the Field for Message to "varchar(252)" vice "text" in the database and stoped giving me error. But I still need to use the type "text" in the database since my "Message" will be longer then 252 caracter. Code:

View Replies View Related

ADO Streams And Binary Data Held In A MySQL Database Blob Field

Has anyone else found a memory leak using ADO streams to access binary data held in a database. I have searched through this forum and have not come across anyone else, so maybe it is just me.

The scenario is as follows:
Windows 2000 SP3
MDAC 2.7 SP1
IIS5
MySQL 3.23
MyODBC 2.50

If I query the database and do a response.binarywrite everything works fine and no memory leak. eg. response.binarywrite myrecordset("blobfield")

If I read the very same BLOB field into a ADOstream I then get a memory leak in DLLHOST.EXE of how big that binary field was. ie If the picture is 140k in size DLLHOST.EXE increases its memory size by 140k.

This keeps on happening until DLLHOST.EXE is something like 250 MBytes in size at which point it stops working. Quick restart of the IIS Web service and I get all my memory back.

The command I am using to get the data into the ADOstream is picturestream.write myrecordset("blobfield")

I have also tried putting the binary data into a variable first before inserting it into the stream:
set x=myrecordset("blobfield")
picturestream.write x

The stream is closed and set to nothing at the end of processing. Everything is cleanly shut down. Through testing I know the memory leak occurs once the data has been written into the stream. The stream is correctly created as type binary.

The stream problem I am encountering does not seem to be limited to ASP, I tried it using Visual Basic to create a COM component to do the same job and still got a memory leak.

So the questions are:
1. Has anyone come across this before or fixed it?
2. Is there another way of getting binary data out of MySQL, something like the opposite of LoadFile?

I have wasted so much time on this problem but cannot find, having searched Microsoft's knowledge base and the rest of the web, any reference to the problem.

View Replies View Related

Getting Id Field After Rs.update

this is a problem that is cropping up for the other developer here and i can't seem to find anything wrong. this code has worked for months and then the last couple of days it started sporadically not working. i'm thinking that it has to do with a performance issue but i'm not sure.

i don't use the ado .addnew or .update, so i'm a bit unfamiliar with the workings of it. here is a brief overview of the code.

ordRs.AddNew
... do the field updates
ordRs.Update
order = cint(ordRS.fields("order_id")

the problem is that order sometimes ends up as null, it's not getting the order_id field after the update. like is said, it's sporadic. anyone have any thoughts here?

View Replies View Related

Update Field

ive got a table filled by a recordset with a column named "STATUS"
each record is a sale transaction. the status of this transaction is either open or closed. right now the table displays whats in the database as is, but i want to add the functionality to be able to close a transaction from the table.
i was thinking of 2 methods, one would be a check to see if the field = open, and if it is, make that field a link to a small popup that verifies the user wants to close the transaction then does its lil sql thing aand updates the table.
the other way i was thinking was to check if its open and make it a drop down list that will update table when submitted.
im veering more toward the former idea(not a fan of drop downs)

View Replies View Related

Update From Same Field

I have a list of names and a box with the age like this:

Name [20]
Name [26]
Name [15]

So i have his code:

View Replies View Related

Update A Field In A Database

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:

View Replies View Related

Update Phone Field

i have a phone field in one of my tables. the data is pretty ate up. there's some numbers with .,- and extra spaces among other things. how can i do a mass update i would like to have all the phone numbers formated like this 555-555-5555 .

View Replies View Related

Update Form Field

I have a asp form that has a dynamic drop-down box that a user selects a value from. Once the user makes a selection I use the onChange event to capture the selection and pass this value to a vbscript sub.

The sub then makes a adsi query using this value to retrieve additional information. This all works. I used a msgbox to display the retrieved value and it is correct. My problem is how do I update a field on the form with this retrieved value?

View Replies View Related

Update A Field For A Bunch Of Records At Once?

My products table has a weight field that I need to populate. A bunch of them have it and a bunch of them don't, but I need them all to have one. The weight is the same, 3, for all the records. I also have an Include field in that table. I want to make the weight field 3 for all records where the include field is true (it's a yes/no checkbox in access.)

I'm using Dreamweaver and I can build the SQL statement just fine but I'm not sure of how to loop through this to set the field for each of these records.

View Replies View Related

Auto Update Table Field

I am developing small asp application.There is a database called db.mdb and there are three tables(tblUser,tbsImport,tblcitylist) In tblcitylist there are two fiedls

1.Town
2.LReg

According to the relevent town there is a LReg (Lreg is a name already assign to the town)
this part is ok.

In my tblUser there is a field called Town and LReg (Same as above table)
But here LReg is empty.I mean there is a default value called "N/A"

I need to create a asp page for following purpose

* i need to read tblcitylist table and according to that I need to fill the LReg fields of TblUser Code:

View Replies View Related

Can Not Update A Record If There Is A ' In The Text Field

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

Update LastLogin Field When User Log Ins

Okay Whenever a user logs in we want to track the last time they logged in. My login script worked perfect before this now I can figure it out. All I did was add the way the table opens and the objRS.Update. Code:

View Replies View Related

Update Database Field Read Only

Trying to update 2 fields. my database is read only..

Microsoft JET Database Engine error '80040e09'

Cannot update. Database or object is read-only.

/sendd.asp, line 16

this is line 16: rsAddComments.AddNew

is this something to do with my server directory permissions?

code .....

View Replies View Related

Using A Variable To Update A Date Field

I've declared a variable for the current date and want to use the UPDATE function to update the date field in a single record.

UPDATE lms_users Set leaver_date ="&MakeDate" WHERE user_id="473"

I know I have the date format in the variable as if I response.write it to the screen is displays correctly (28/08/2004). I must be doing something really silly, but can't see it.

View Replies View Related

Automatic Form Field Update

I have a form where the first field is a dynamic drop-down that pulls from a db (Access). The fields associated with the query are task_id, task_name and task_rate. The field has the value of "task_id" and the label of "task_name".

In the second form field, I would like the default value to be determined by the selection made in the first field. Based on the selection of the first form field, I would like the default value of the this field (task_rate) to be populated with the associated task_rate value of the selection chosen above.

View Replies View Related

I Wan't Any Function To Update The Db Field When Checking A Check Box

is there any one know how to make function to update db field and to be called on checking a check books.

View Replies View Related

Stuck On Update Multiple Records (same Field)

how to update a database from a dynamic table with checkbox. Their is only one field I would like to change and that is the one with the checkbox.

I am using Dreamweaver and I create a dynamic table, add the update record and I get BOF EOF error. The database does have data in it. Code:

View Replies View Related

Update Field Based On List Selection

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:

View Replies View Related

How To Tie RegID To Form To Update (batch Update)

Okay there is an unique EventRegID for every registration. When people first register they get pre-registered. Then an admin comes in and confirms or wait list them (based on whatever requirements). My question is how can I tie the EventRegID to a form with multipule ID's so they can batch confirm or wait list the PreReg list? Code:

View Replies View Related

LEFT JOIN On A Date Field And A Numerical Field - Using WHERE Clause

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

Comparing Field Data From Previous Field

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

Fill Field Based On Another Field

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

Pass Hidden Form Field Value To Another Form Field To Insert In Db

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

How Can I Change One Line Input Field Into Larger Input Field

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

Use Mysql With VB6

I am trying to connect to a Mysql database in the following manner:

Dim conn As ADODB.Connection
Set conn = New ADODB.Connection

Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset

conn.CursorLocation = adUseClient
conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=myserver;PORT=3306;DATABASE=mydatabase; USER=myusername;PASSWORD=mypassword;OPTION=3;"

however I am getting an error:

visual basic run-time error microsoft [odbc driver manager] data source name not found and no default driver specified.

View Replies View Related

C# Asp Mysql

How do you add data to the tables from asp website using C# (for mysql)

View Replies View Related

Mysql With ASP

Our website is currently developed in ASP/Mysql 4.
The dedicated servers on which it is currently hosted arrive at saturation.
Here is their configuration:
- 1 server PIV 2,8Ghz 1GB RAM with IIS 5 on Windows 2000
- 1 server Bi-xeon 3Ghz, 512 MB with MySQL 4 on Windows 2003
The website makes approximately 10.000.000 of pages seen and 310.000
visits each month (given by an external statistics tool), increasing by
10% each month.
The database is approximately 60 MB.
I made, I think, most of the optimizations on the database (cache,
indexes...).
According to our current web hoster, this saturation is due to a bad
management of connections between ASP and MySQL and recommends to us:
1/ to put the site on Windows 2003/IIS 6.
2/ to change our database from MySQL to SQL Server.
3/ to change our PIV to a second Bi-xeon.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved