Connecting Oracle to VB!!!

Discussion in 'Software Q&A' started by deepak.krishnan, Sep 28, 2006.

Thread Status:
Not open for further replies.
  1. deepak.krishnan

    deepak.krishnan New Member

    Joined:
    Jan 11, 2005
    Messages:
    423
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Palakkad/Bangalore
    Hello friends,
    I got a problem while executing the following code:
    This code is in a module:

    Public con As New ADODB.Connection
    Public rs1 As ADODB.Recordset
    Public rs2 As ADODB.Recordset

    The following code is in the form:

    Private Sub Form_Load()
    con.Open "Provider=MSDAORA;user id=scott;password=tiger;"
    rs1.Open "notes", con, adOpenDynamic, adLockOptimistic
    Set txtnb.DataSource = rs1
    txtnb.DataField = "NOTES"
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    frmintro.Show
    End Sub

    Private Sub imgback_Click()
    If rs1.BOF = True Then
    rs1.MoveLast
    MsgBox "This is the first record. Now the last record saved will be opened"
    Else
    rs1.MovePrevious
    End If
    End Sub

    Private Sub imgdel_Click()
    rs1.Delete
    End Sub

    Private Sub imgfw_Click()
    If rs1.EOF = True Then
    rs1.MoveFirst
    MsgBox "This is the last record. Now the first record saved will be opened"
    Else
    rs1.MoveNext
    End If
    End Sub

    Private Sub imgnew_Click()
    rs1.AddNew
    End Sub

    Private Sub imgprint_Click()
    cdmain.ShowPrinter
    End Sub

    Private Sub imgsave_Click()
    rs1.Update
    rs1.MoveNext
    End Sub


    Now when I execute this code I get an error saying that the field cannot be updated due to datatype or lock type .
    Can any one of you please tell me what is the problm with the code?
     
    Last edited: Sep 28, 2006
  2. ayush_chh

    ayush_chh Member

    Joined:
    Nov 25, 2005
    Messages:
    525
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bangalore
    it's a long time since i worked on VB:( but the error u r talking of, occurs due to the settings i hav highlighted.... try changing it i.e. use other options...:)

    i think it might help....
     
  3. OP
    OP
    deepak.krishnan

    deepak.krishnan New Member

    Joined:
    Jan 11, 2005
    Messages:
    423
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Palakkad/Bangalore
    Thanks It worked out fine......
     
  4. DukeNukem

    DukeNukem Come get Some

    Joined:
    Aug 28, 2005
    Messages:
    417
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Home Sweet Home
    BUY a Book called "MASTERIN VB 6" from Evangelous
    INSTALL MSDN 2001 for better reference
     
Thread Status:
Not open for further replies.

Share This Page