If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > AS400 SQL UPDATE Error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-05-04, 16:59
aclark aclark is offline
Registered User
 
Join Date: Mar 2002
Posts: 3
AS400 SQL UPDATE Error

I am trying to update a database on my AS400 using an Active Server Page with the following code, but it gives me an error:

<%
'-------------------------------------------------------------------------------------------------------------------------
'Retrieve selection criteria field names from the form on the previous screen
Yr = numeric
Yr = Request.Form("pyear") 'Year CCYY
Lbs = numeric
Lbs = Request.Form("intLbs")
'-------------------------------------------------------------------------------------------------------------------------
Set conn400 = Server.CreateObject("ADODB.Connection")
Set rs400 = Server.CreateObject("ADODB.Recordset")
conn400.open ="DSN=MYAS400;User ID=MYUSERID;Password=MYPASSWORD;"
'-------------------------------------------------------------------------------------------------------------------------
'Set up the SQL Statement
SQL400 = "UPDATE FROM XLIB.WINNLBS SET SLLBSSM = Lbs WHERE SLWEYR = (" & intYr & ")"
'-------------------------------------------------------------------------------------------------------------------------
'Connect the Record Set to the Database
set rs400.ActiveConnection=conn400
'-------------------------------------------------------------------------------------------------------------------------
'Process the SQL Statement
rs400.Open SQL400
'-------------------------------------------------------------------------------------------------------------------------
'If the connection to the database is good then process records
if conn400.errors.count=0 Then
'-------------------------------------------------------------------------------------------------------------------------
'Read first record only
rs400.MoveFirst
if Not rs400.EOF Then
End If
End If
%>

I get this error on the line rs400.Open SQL400:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E09)
[Wall Data][RUMBA Data Access][S101125D]Syntax error or access violation. The request cannot be executed because the data source connection is read-only.

Any suggestions on how to update a record on my AS400 would be appreciated.
Reply With Quote
  #2 (permalink)  
Old 02-05-04, 18:02
aclark aclark is offline
Registered User
 
Join Date: Mar 2002
Posts: 3
Re: AS400 SQL UPDATE Error

I found the error, my RUMBA ODBC Driver was set to read only.


Quote:
Originally posted by aclark
I am trying to update a database on my AS400 using an Active Server Page with the following code, but it gives me an error:

<%
'-------------------------------------------------------------------------------------------------------------------------
'Retrieve selection criteria field names from the form on the previous screen
Yr = numeric
Yr = Request.Form("pyear") 'Year CCYY
Lbs = numeric
Lbs = Request.Form("intLbs")
'-------------------------------------------------------------------------------------------------------------------------
Set conn400 = Server.CreateObject("ADODB.Connection")
Set rs400 = Server.CreateObject("ADODB.Recordset")
conn400.open ="DSN=MYAS400;User ID=MYUSERID;Password=MYPASSWORD;"
'-------------------------------------------------------------------------------------------------------------------------
'Set up the SQL Statement
SQL400 = "UPDATE FROM XLIB.WINNLBS SET SLLBSSM = Lbs WHERE SLWEYR = (" & intYr & ")"
'-------------------------------------------------------------------------------------------------------------------------
'Connect the Record Set to the Database
set rs400.ActiveConnection=conn400
'-------------------------------------------------------------------------------------------------------------------------
'Process the SQL Statement
rs400.Open SQL400
'-------------------------------------------------------------------------------------------------------------------------
'If the connection to the database is good then process records
if conn400.errors.count=0 Then
'-------------------------------------------------------------------------------------------------------------------------
'Read first record only
rs400.MoveFirst
if Not rs400.EOF Then
End If
End If
%>

I get this error on the line rs400.Open SQL400:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E09)
[Wall Data][RUMBA Data Access][S101125D]Syntax error or access violation. The request cannot be executed because the data source connection is read-only.

Any suggestions on how to update a record on my AS400 would be appreciated.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On