Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004

    Exclamation Unanswered: dynamic stored procedure

    i have a stored procedure, that loads perfect in visual basic except i cannot edit the records.
    in microsoft access i can, when i run the stored procedure.

    what possible solutions could get around this? as i need to get the fields from different tables

    Dim Cmd As New ADODB.Command
    Dim cmdtxt As String
             Set Cmd.ActiveConnection = frm_main.db
                Cmd.CommandText = "Rollcall"
             Cmd.CommandType = adCmdStoredProc
             Cmd.Parameters.Append Cmd.CreateParameter("[@Rollid]", adVariant, adParamInput, 2) 
             Cmd.Parameters(0).Value = rollsid
    Set adoPrimaryRS = New ADODB.Recordset
    adoPrimaryRS.Open Cmd, , adOpenDynamic, adLockOptimistic
    Set DataGrid1.DataSource = adoPrimaryRS
    when i try to edit a record it comes up with a runtime saying
    Insufficient key column information for updating or refreshing.
    i need help asap,
    thankyou in advance. james

  2. #2
    Join Date
    Jul 2003
    What does your stored procedure look like? is it just a select query? or does it have something that allows your to write back to the record?

    I assume that you are editing the data in your data grid... is it possible that your SP is only retreiving data and not capable of writing?

    how is it a dynamic SP?


  3. #3
    Join Date
    Sep 2004
    ahh i had help from a database admin

    it is dynamic because i can edit it. the problem was that access didnt know where to write back the record. since i was only interested in editing one field out of all the returned rows i only needed the id of that table to be there too

    i had a table rollitem, with the record 'mark'
    another one student, with 'first name' and 'last name'
    the sp returned all of those fields, while only mark was ment to be edited.

    i fixed it by adding rollitems primary key to the sp, then access knew where to edit.

    thanks anyway guys.

Posting Permissions

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