473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

update recored sql

59
I'm making a form for changing a user password and information
and tring to update the recoreds.

maybe the problam has nothing to do with what I'm thinking.. but that is what I tried:

when I try
rs.Open strSQL, oconn
or
rs.Open strSQL, oconn, 3
or
rs.Open strSQL, oconn, 2
or
rs.Open strSQL, oconn, 1
or
rs.Open strSQL, oconn, -1

I get this error:

Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
/setup.asp, line 33

when I try
rs.Open strSQL, oconn, adOpenKeyset, adLockPessimistic, adCmdText
or
rs.Open strSQL, oconn, 4

I get this error:

Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/setup.asp, line 16
Mar 6 '08 #1
7 1525
markrawlingson
346 Expert 100+
Try rs.Open strSQL, oconn, 3, 3

btw, the second error is probably appearing because your ADO constants aren't properly declared anywhere.

Sincerely,
Mark


I'm making a form for changing a user password and information
and tring to update the recoreds.

maybe the problam has nothing to do with what I'm thinking.. but that is what I tried:

when I try
rs.Open strSQL, oconn
or
rs.Open strSQL, oconn, 3
or
rs.Open strSQL, oconn, 2
or
rs.Open strSQL, oconn, 1
or
rs.Open strSQL, oconn, -1

I get this error:

Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
/setup.asp, line 33

when I try
rs.Open strSQL, oconn, adOpenKeyset, adLockPessimistic, adCmdText
or
rs.Open strSQL, oconn, 4

I get this error:

Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/setup.asp, line 16
Mar 6 '08 #2
zivon
59
first thanks for answering.

what you gave me give me the folloing error:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only.
/setup.asp, line 42

so I tried 3, 4

and it didn't give me any error, but also didn't update the records : \

maybe this is not the way ?
rs("Email") = Request.Form("email")



Try rs.Open strSQL, oconn, 3, 3

btw, the second error is probably appearing because your ADO constants aren't properly declared anywhere.

Sincerely,
Mark
Mar 7 '08 #3
idsanjeev
241 100+
Hi
If your error reported Cannot update. Database or object is read-only.
please check your database permission and give permission to full control if have permission to read only
thanks
Mar 7 '08 #4
DrBunchman
979 Expert 512MB
The problem is you are trying to change a recordset object which is read-only.

Have you tried updating the database like this:

sSQL = "UPDATE Table1 SET Email = '" & Request.Form("email") & "' WHERE Something = '" & SomethingElse & "' "
oConn.Execute sSQL

oConn is your database connection object, Table1 is the name of your table and Something & SomethingElse is your condition e.g. username = 'Fred'

If this doesn't work then you may have a permissions issue. Let me know how you get on.

Dr B
Mar 7 '08 #5
zivon
59
The file is not read-only, maybe the server managment, but I have no idea how to change it... its on my pc..

any way, when I try the line you just gave me this is what I get:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/setup.asp, line 20


this is the line:
Expand|Select|Wrap|Line Numbers
  1.     sSQL = "UPDATE Admin SET Email = '" & Request.Form("email") & "' WHERE User='" & Session("IdUser") & "'" 



The problem is you are trying to change a recordset object which is read-only.

Have you tried updating the database like this:

sSQL = "UPDATE Table1 SET Email = '" & Request.Form("email") & "' WHERE Something = '" & SomethingElse & "' "
oConn.Execute sSQL

oConn is your database connection object, Table1 is the name of your table and Something & SomethingElse is your condition e.g. username = 'Fred'

If this doesn't work then you may have a permissions issue. Let me know how you get on.

Dr B
Mar 7 '08 #6
DrBunchman
979 Expert 512MB
I think I'm wrong then - it's nothing to do with the recordset and it is a permission problem <hangs head in shame>

When you say the file I presume you mean the .mdb file? What sort of security are you using for your site?

If it's anonymous has your IUSR_<machineName> account got appropriate read/write access?

If it's Windows Authentication have you got sufficient security or are you in a group that has?

Have you tried setting the connection mode prior to opening it e.g.

Expand|Select|Wrap|Line Numbers
  1. Set oConn = CreateObject("ADODB.Connection") 
  2. oConn.mode = 3
Dr B
Mar 7 '08 #7
idsanjeev
241 100+
Hi zivon
you are sure the database not read only or you don't know how to check it
if you are using mode type suggested by experts then i think the problems to your database please check it by
1) write click on database
2) select properties
3) select security and check permission full control
if database is already checked full control then attached your code with a attachment .
Thanks
Mar 8 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Dave | last post by:
I have 2 tables, one with names, and another with addresses, joined by their CIVICID number (unique to the ADDRESSINFO table) in Oracle. I need to update a field in the NAMEINFO table for a...
8
by: Lauren Quantrell | last post by:
In VBA, I constructed the following to update all records in tblmyTable with each records in tblmyTableTEMP having the same UniqueID: UPDATE tblMyTable RIGHT JOIN tblMyTableTEMP ON...
27
by: VK | last post by:
<http://www.jibbering.com/faq/#FAQ3_2> The parts where update, replacement or add-on is needed are in <update> tag. 3.2 What online resources are available? Javascript FAQ sites, please...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
9
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from...
8
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. ...
7
ak1dnar
by: ak1dnar | last post by:
There are two tables in my database 1. Table_A 2. Table_B Structure for Table_A A_ID - A_code(FK to B_ID) 1001 - Null 1002 - Null 1003 - Null
0
by: tkatny | last post by:
How I Include External Input In Recored Macro. I Need The Macro To Pause Two (2) Times In Each Run And Repet Macro 20 Times. Thanks, Tad
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.