No Backwards Fetching


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: No Backwards Fetching

Hybrid View

  1. #1
    Brian Guest

    No Backwards Fetching


    Hello.
    I'm opening a recordset using this code. When I try to MoveLast and MoveFirst
    I get an error that says:"This rowset doesn't support fetching backward."

    Set adoRS = New ADODB.Recordset 'Create ADO Recordset Object.
    adoRS.CursorType = adOpenDynamic
    adoRS.Open strSQL, conODBC, , adLockOptimistic,adCmdText

    adoRS.MoveLast
    adoRS.MoveFirst


    I can open the recordset using DAO and it works just fine
    What on Earth am I missing?

    Thank you.

  2. #2
    Craig Brown Guest

    Re: No Backwards Fetching


    Brian,

    I had this problem a while back(i.e. switching from DAO to ADO, one working
    the other not).

    My gut reaction is, the SQL returned an empty recordset (one of my problems...).
    The other possibility is that you've changed your SQL statement and re-executed
    the code(the other problem...). I think I solved this one by executing a
    Close first and then the Open, using On Error Resume Next before it, resetting
    the error handling after it.

    Craig Brown

    "Brian" <uplate@aspi.net> wrote:
    >
    >Hello.
    >I'm opening a recordset using this code. When I try to MoveLast and MoveFirst
    >I get an error that says:"This rowset doesn't support fetching backward."
    >
    >Set adoRS = New ADODB.Recordset 'Create ADO Recordset Object.
    >adoRS.CursorType = adOpenDynamic
    >adoRS.Open strSQL, conODBC, , adLockOptimistic,adCmdText
    >
    >adoRS.MoveLast
    >adoRS.MoveFirst
    >
    >
    >I can open the recordset using DAO and it works just fine
    >What on Earth am I missing?
    >
    >Thank you.



  3. #3
    Paul Clement Guest

    Re: No Backwards Fetching

    On 2 Jan 2001 13:53:59 -0800, "Brian" <uplate@aspi.net> wrote:


    Hello.
    I'm opening a recordset using this code. When I try to MoveLast and MoveFirst
    I get an error that says:"This rowset doesn't support fetching backward."

    Set adoRS = New ADODB.Recordset 'Create ADO Recordset Object.
    adoRS.CursorType = adOpenDynamic
    adoRS.Open strSQL, conODBC, , adLockOptimistic,adCmdText

    adoRS.MoveLast
    adoRS.MoveFirst


    I can open the recordset using DAO and it works just fine
    What on Earth am I missing?

    Well, you didn't specify the CursorLocation value so it is defaulting to server-side. Does the
    back-end database you are using supported scrolling server-side cursors?


    Paul ~~~ pclement@ameritech.net
    Microsoft MVP (Visual Basic)

  4. #4
    vijay Guest

    Re: No Backwards Fetching


    "Brian" <uplate@aspi.net> wrote:
    >
    >Hello.
    >I'm opening a recordset using this code. When I try to MoveLast and MoveFirst
    >I get an error that says:"This rowset doesn't support fetching backward."
    >
    >Set adoRS = New ADODB.Recordset 'Create ADO Recordset Object.
    >adoRS.CursorType = adOpenDynamic
    >adoRS.Open strSQL, conODBC, , adLockOptimistic,adCmdText
    >
    >adoRS.MoveLast
    >adoRS.MoveFirst
    > and also i have problem in vb as well as oracle

    when i am inserting value in front end (vb) which allows to send information
    in oracle but when i am trying to receive info back with same name but different
    info it will not show me other info about previous entry

    eg.

    project name :
    client name
    start name
    end date
    amount

    in above example if i write same project naame but different client name
    etc it will give me only one entry of one project could you able to help
    me with codes
    i am also sending the vb code i wrote so it will be helpful for you o see
    where did i made a mistake


    Option Explicit
    Dim tabInfo As Integer
    Dim counter As Integer
    Dim cnStr As ADODB.Connection
    Dim rsStr As ADODB.Recordset
    Dim rsStr1 As ADODB.Recordset
    Dim rsCmd As ADODB.Command


    Private Sub Combo2_Click()
    Text13.Text = ""
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenStatic
    rsStr.CursorLocation = adUseClient
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "client", cnStr, , , adCmdTable
    rsStr.Find "client_name = '" & Combo2.Text & "'"

    On Error Resume Next
    Text13.Text = rsStr.Fields.Item(2)

    Set rsStr = Nothing
    Set cnStr = Nothing

    End Sub

    Private Sub Combo3_Click()

    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenStatic
    rsStr.CursorLocation = adUseClient
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "skill", cnStr, , , adCmdTable
    rsStr.Find "skill_name = '" & Combo3.Text & "'"

    On Error Resume Next
    Text14.Text = rsStr.Fields.Item(2)

    Set rsStr = Nothing
    Set cnStr = Nothing

    End Sub


    Private Sub Combo4_Click()

    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenStatic
    rsStr.CursorLocation = adUseClient
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "team", cnStr, , , adCmdTable
    rsStr.Find "last_name = '" & Combo4.Text & "'"
    On Error Resume Next
    Text10.Text = rsStr.Fields.Item(2)
    On Error Resume Next
    Text11.Text = rsStr.Fields.Item(3)
    On Error Resume Next
    Text8.Text = rsStr.Fields.Item(4)
    Set rsStr = Nothing
    Set cnStr = Nothing

    End Sub



    Private Sub Combo5_Click()

    Dim var1 As String
    Dim var2 As String
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenStatic
    rsStr.CursorLocation = adUseClient
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "training", cnStr, , , adCmdTable
    rsStr.Find "class_name = '" & Combo5.Text & "'"
    On Error Resume Next
    var1 = rsStr.Fields.Item(2)
    On Error Resume Next
    Text12.Text = rsStr.Fields.Item(3)
    On Error Resume Next
    Text15.Text = rsStr.Fields.Item(4)

    rsStr.Close
    rsStr.Open "partners", cnStr, , , adCmdTable
    rsStr.Find "partner_code = " + var1
    On Error Resume Next
    var2 = rsStr.Fields.Item(1)

    Set rsStr = Nothing
    Set cnStr = Nothing
    Combo8.Clear
    Combo8.Text = var2

    End Sub

    Private Sub Combo7_Click()

    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenStatic
    rsStr.CursorLocation = adUseClient
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "partners", cnStr, , , adCmdTable
    rsStr.Find "partner_name = '" & Combo7.Text & "'"

    On Error Resume Next
    Text5.Text = rsStr.Fields.Item(3)
    On Error Resume Next
    Text6.Text = rsStr.Fields.Item(2)
    On Error Resume Next
    Text7.Text = rsStr.Fields.Item(4)
    On Error Resume Next
    Text9.Text = rsStr.Fields.Item(5)

    Set rsStr = Nothing
    Set cnStr = Nothing
    End Sub



    Private Sub Combo9_Click()

    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenStatic
    rsStr.CursorLocation = adUseClient
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "member_role", cnStr, , , adCmdTable
    rsStr.Find "role_name = '" & Combo9.Text & "'"
    On Error Resume Next
    Text16.Text = rsStr.Fields.Item(2)

    Set rsStr = Nothing
    Set cnStr = Nothing
    'RSCMD.Execute(
    End Sub

    Private Sub Command1_Click()
    Unload Form1

    End Sub

    Private Sub CmdDelete_Click()
    If tabInfo = 0 Then
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    cnStr.Execute "delete from projects where project_name='" & Combo1.Text
    & "'"
    cnStr.Execute "delete from client where client_name='" & Combo6.Text
    & "'"
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenStatic
    rsStr.CursorLocation = adUseClient
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "projects", cnStr, , , adCmdTable
    Set rsStr = Nothing
    Set cnStr = Nothing
    MsgBox "successfully deleted the record..."
    Combo1.Clear
    Combo6.Clear
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    End If

    If tabInfo = 1 Then
    Set cnStr = New ADODB.Connection
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    cnStr.Execute "delete from client where client_name='" & Combo2.Text
    & "'"
    Set cnStr = Nothing
    MsgBox "successfully deleted the record..."
    Combo2.Clear
    Text13.Text = ""
    End If


    If tabInfo = 2 Then
    Set cnStr = New ADODB.Connection
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    cnStr.Execute "delete from skill where skill_name='" & Combo3.Text &
    "'"
    Set cnStr = Nothing
    MsgBox "successfully deleted the record..."
    Combo3.Clear
    Text14.Text = ""
    End If


    If tabInfo = 3 Then
    Set cnStr = New ADODB.Connection
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    cnStr.Execute "delete from team where last_name='" & Combo4.Text & "'"
    Set cnStr = Nothing
    MsgBox "successfully deleted the record..."
    Combo4.Clear
    Text8.Text = ""
    Text10.Text = ""
    Text11.Text = ""
    End If

    If tabInfo = 4 Then
    Set cnStr = New ADODB.Connection
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    cnStr.Execute "delete from Training where class_name ='" & Combo5.Text
    & "'"
    cnStr.Execute "delete from partners where Partner_name ='" & Combo8.Text
    & "'"
    Set cnStr = Nothing
    MsgBox "successfully deleted the record..."
    Combo5.Clear
    Combo8.Clear
    Text15.Text = ""
    Text12.Text = ""
    End If


    If tabInfo = 5 Then
    Set cnStr = New ADODB.Connection
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    cnStr.Execute "delete from member_role where role_name ='" & Combo9.Text
    & "'"
    Set cnStr = Nothing
    MsgBox "successfully deleted the record..."
    Combo9.Clear
    Text16.Text = ""
    End If


    If tabInfo = 6 Then
    Set cnStr = New ADODB.Connection
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    cnStr.Execute "delete from partners where partner_name ='" & Combo7.Text
    & "'"
    Set cnStr = Nothing
    MsgBox "successfully deleted the record..."
    Combo7.Clear
    Text5.Text = ""
    Text6.Text = ""
    Text7.Text = ""
    Text9.Text = ""
    End If

    End Sub

    Private Sub CmdNew_Click()
    Combo1.Text = "New Project"
    Combo3.Text = "New Skills"
    Combo4.Text = "New Team"
    Combo6.Text = "New Client"
    Combo2.Text = "New Client"
    Combo7.Text = "New Partner"
    Combo5.Text = "New Class"
    Combo8.Text = "New Partner"
    Combo9.Text = "New Member Role"
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    Text5.Text = ""
    Text6.Text = ""
    Text7.Text = ""
    Text8.Text = ""
    Text9.Text = ""
    Text13.Text = ""
    Text14.Text = ""
    Text10.Text = ""
    Text11.Text = ""
    Text12.Text = ""
    Text15.Text = ""
    Text16.Text = ""

    End Sub

    Private Sub cmdSave_Click()
    If tabInfo = 0 Then
    counter = 0
    If Combo1.Text <> "" Then
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenDynamic
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "projects", cnStr, , , adCmdTable
    Do While rsStr.EOF = False
    rsStr.MoveNext
    counter = counter + 1
    Loop
    rsStr.Close
    rsStr.Open "projects", cnStr, , , adCmdTable
    rsStr.AddNew
    rsStr!project_name = UCase(Combo1.Text)
    rsStr!client_code = 100 + counter + 1
    rsStr!start_date = Text1.Text
    rsStr!estimated_end_date = Text2.Text
    rsStr!contract_revenue = Text3.Text
    rsStr!Notes = Text4.Text
    rsStr.UpdateBatch
    rsStr.Close
    rsStr.Open "client", cnStr, , , adCmdTable
    rsStr.AddNew
    rsStr!client_name = UCase(Combo6.Text)
    rsStr!client_code = 100 + counter + 1
    rsStr.UpdateBatch
    Set rsStr = Nothing
    Set cnStr = Nothing
    MsgBox "successfully created new record for Project..."
    Else
    MsgBox "you cann't save empty value..."
    End If
    End If


    If tabInfo = 1 Then
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenDynamic
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "client", cnStr, , , adCmdTable
    rsStr.AddNew
    rsStr!client_name = Combo2.Text
    rsStr!Notes = Text13.Text
    rsStr.UpdateBatch
    Set rsStr = Nothing
    Set cnStr = Nothing
    MsgBox "successfully created new record for Client..."
    End If


    If tabInfo = 2 Then
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenDynamic
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "skill", cnStr, , , adCmdTable
    rsStr.AddNew
    rsStr!skill_name = Combo3.Text
    rsStr!Notes = Text14.Text
    rsStr.UpdateBatch
    Set rsStr = Nothing
    Set cnStr = Nothing
    MsgBox "successfully created new record for Skill..."
    End If


    If tabInfo = 3 Then
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenDynamic
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "team", cnStr, , , adCmdTable
    rsStr.AddNew
    rsStr!last_name = Combo4.Text
    rsStr!first_name = Text10.Text
    rsStr!mobile = Text11.Text
    rsStr!Notes = Text8.Text
    rsStr.UpdateBatch
    Set rsStr = Nothing
    Set cnStr = Nothing
    MsgBox "successfully created new record for Team..."
    End If

    If tabInfo = 4 Then
    counter = 0
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenDynamic
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "training", cnStr, , , adCmdTable
    Do While rsStr.EOF = False
    rsStr.MoveNext
    counter = counter + 1
    Loop
    rsStr.Close

    rsStr.Open "training", cnStr, , , adCmdTable
    rsStr.AddNew
    rsStr!class_name = Combo5.Text
    rsStr!partner_code = 1000 + counter + 1
    rsStr!duration = Text12.Text
    rsStr!Notes = Text15.Text
    rsStr.UpdateBatch
    rsStr.Close

    rsStr.Open "partners", cnStr, , , adCmdTable
    rsStr.AddNew
    rsStr!partner_name = Combo8.Text
    rsStr!partner_code = 1000 + counter + 1
    rsStr!Notes = Text15.Text
    rsStr.UpdateBatch

    Set rsStr = Nothing
    Set cnStr = Nothing
    MsgBox "successfully created new record for Training..."
    End If


    If tabInfo = 5 Then
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenDynamic
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "member_role", cnStr, , , adCmdTable
    rsStr.AddNew
    rsStr!role_name = Combo9.Text
    rsStr!Notes = Text16.Text
    rsStr.UpdateBatch
    Set rsStr = Nothing
    Set cnStr = Nothing
    MsgBox "successfully created new record for Member Role..."
    End If


    If tabInfo = 6 Then
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenDynamic
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "partners", cnStr, , , adCmdTable
    rsStr.AddNew
    rsStr!partner_name = Combo7.Text
    rsStr!contact_lname = Text5.Text
    rsStr!contact_fname = Text6.Text
    rsStr!contact_phone = Text7.Text
    rsStr!Notes = Text9.Text
    rsStr.UpdateBatch
    Set rsStr = Nothing
    Set cnStr = Nothing
    MsgBox "successfully created new record for Partner..."
    End If


    End Sub



    Private Sub Combo1_Click()
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    Dim var1 As String
    Dim var2 As String
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    'cnStr.Execute "select client_name from client where client_code = (select
    client_code from projects where project_name = '" & Combo1.Text & "')"
    Set rsStr.ActiveConnection = cnStr
    rsStr.CursorType = adOpenStatic
    rsStr.CursorLocation = adUseClient
    rsStr.LockType = adLockBatchOptimistic
    rsStr.Open "projects", cnStr, , , adCmdTable
    rsStr.Find "project_name = '" & Combo1.Text & "'", SearchDirection:=adSearchForward
    On Error Resume Next
    If (rsStr.EOF) Or (rsStr.BOF) Then
    MsgBox ("Error, No match Found!")
    End If
    var1 = rsStr.Fields.Item(2)
    'MsgBox var1
    On Error Resume Next
    Text1.Text = rsStr.Fields.Item(3)
    On Error Resume Next
    Text2.Text = rsStr.Fields.Item(4)
    On Error Resume Next
    Text3.Text = rsStr.Fields.Item(5)
    On Error Resume Next
    Text4.Text = rsStr.Fields.Item(6)

    rsStr.Close
    rsStr.Open "client", cnStr, , , adCmdTable
    rsStr.Find "client_code = " + var1
    On Error Resume Next
    var2 = rsStr.Fields.Item(1)

    Set rsStr = Nothing
    Set cnStr = Nothing
    Combo6.Clear
    Combo6.Text = var2
    End Sub



    Private Sub Form_Initialize()
    Combo1.AddItem "ML-IBK"
    Combo1.AddItem "DB-GIB"
    Combo1.AddItem "LAZARD-LIDS"
    Combo1.AddItem "LAZARD Web Admin"
    Combo5.AddItem "DCTM Fund"
    Combo5.AddItem "DCTM WDK"
    Combo5.AddItem "Arbor Text Development Workshop"
    Combo5.AddItem "Java Bean"
    Combo6.AddItem "Merrill Lynch-PC"
    Combo6.AddItem "Merrill Lynch-LICG"
    Combo6.AddItem "Merrill Lynch Investment Managers"
    Combo6.AddItem "SSB"
    Combo6.AddItem "LAZARD"
    Combo6.AddItem "Lehman Brothers"
    Combo7.AddItem "Documentum"
    Combo7.AddItem "Arbor Text"
    Combo7.AddItem "XMetal"
    Combo7.AddItem "BEA"
    Combo7.AddItem "SUN"
    Combo7.AddItem "ORACLE"
    Combo9.AddItem "Project manager"
    Combo9.AddItem "Businerr Analyst"
    Combo9.AddItem "Solution Architect"
    Combo9.AddItem "Technical Lead"
    Combo9.AddItem "Developer"

    End Sub

    Private Sub Form_Load()
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.Open "projects", cnStr, , , adCmdTable
    Do While rsStr.EOF = False
    Combo1.AddItem rsStr.Fields.Item(1)
    rsStr.MoveNext
    Loop
    Set rsStr = Nothing
    Set cnStr = Nothing

    End Sub

    Private Sub SSTab1_Click(PreviousTab As Integer)
    tabInfo = SSTab1.Tab
    If tabInfo = 0 Then
    Combo1.Clear
    Combo6.Clear
    Combo5.Clear
    Combo8.Clear
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    Text12.Text = ""
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    Set rsStr1 = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.Open "projects", cnStr, , , adCmdTable
    rsStr1.Open "client", cnStr, , , adCmdTable
    Do While rsStr.EOF = False

    Combo1.AddItem rsStr.Fields.Item(1)

    rsStr.MoveNext
    Loop
    Do While rsStr1.EOF = False
    Combo6.AddItem rsStr1.Fields.Item(1)
    rsStr1.MoveNext
    Loop

    Set rsStr = Nothing
    Set cnStr = Nothing
    End If

    If tabInfo = 1 Then
    Combo2.Clear
    Text13.Text = ""
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.Open "client", cnStr, , , adCmdTable
    Do While rsStr.EOF = False
    Combo2.AddItem rsStr.Fields.Item(1)
    rsStr.MoveNext
    Loop
    Set rsStr = Nothing
    Set cnStr = Nothing
    End If
    If tabInfo = 2 Then
    Combo3.Clear
    Text14.Text = ""
    Set cnStr = New ADODB.Connection
    Set rsStr = New ADODB.Recordset
    cnStr.ConnectionString = "DSN=ora1;UID=scott;PWD=tiger;"
    cnStr.Open
    Set rsStr.ActiveConnection = cnStr
    rsStr.Open "skill", cnStr, , , adCmdTable
    Do While rsStr.EOF = False
    'Combo3.AddItem rsStr.Fields.Item(1)
    rsSt220 8278 <3a58fde4$1@news.devx.com> article retrieved - head and body follows
    From: "codemasterj" <codemasterj@netscape.net>
    Sender: "codemasterj" codemasterj@netscape.net
    Reply-To: "codemasterj" <codemasterj@netscape.net>
    Subject: Re: Insufficient Key Column... for updating or refreshing
    Newsgroups: vb.database.ado
    X-User-Info: 24.48.17.181 24.48.17.181
    References: <3a5501f9$1@news.devx.com>
    NNTP-Posting-Host: 209.1.14.192
    Message-ID: <3a58fde4$1@news.devx.com>
    Date: 7 Jan 2001 15:38:12 -0800
    X-Trace: 7 Jan 2001 15:38:12 -0800, 209.1.14.192
    Lines: 35
    Path: news.devx.com!209.1.14.192
    Xref: news.devx.com vb.database.ado:8278


    Jeff:

    Without seeing a bit more of how you're getting into this,
    this is a little difficult to answer. In any event, after
    the update/add is completed try doing a Requery on the
    rsProduct object to refresh the recordset data with your
    changes. Then go to the bookmark.

    Hope that helps.


    codemasterj


    "Jeff" <jeffm@earthlink.net> wrote:
    >
    >Problem saving new values to an existing recordset (w/Left Join).
    >
    >Get same error if I do something like this:
    >
    >ProductBkMk = rsProduct.BookMark
    >
    >SearchClient.Show vbModal '<- this form opens other recordset
    >
    >rsProduct.BookMark = ProductBkMk '<- will get error here
    >
    >
    >What am I doing wrong?
    >
    >
    >
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center