Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2002
    Posts
    3

    Unanswered: 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.

  2. #2
    Join Date
    Mar 2002
    Posts
    3

    Re: AS400 SQL UPDATE Error

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


    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •