vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I am attempting to call RUNSTATS_KEY from VBA code and everything looks coorect to me, however when I run it, it errors out. The code snippet is below... Set cmd = New ADODB.Command cmd.ActiveConnection = conDatabase cmd.CommandText = "spinload.runstats_key" cmd.CommandType = adCmdStoredProc cmd.CommandTimeout = 3600 cmd.Parameters.Append _ cmd.CreateParameter(, adVarChar, adParamInput, 255, "SESSION.DATA_CUBE_EXTRACT") Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset Set rs = cmd.Execute Does anyone have any ideas what might be causing this problem? I can run the CALL command to runstats myself when at a command line, or from the control centerl, but from VBA it just doesn't want to work. If anyone has any alternate ideas for collecting the stats let me know, but obviously Shell won't work since this is a session table, thus belonging to the login from excel. |
| |||
| "DW Marker" <dwmarker@yahoo.com> wrote in message news:1149176792.367318.250090@g10g2000cwb.googlegr oups.com... >I am attempting to call RUNSTATS_KEY from VBA code and everything looks > coorect to me, however when I run it, it errors out. The code snippet > is below... > > Set cmd = New ADODB.Command > cmd.ActiveConnection = conDatabase > cmd.CommandText = "spinload.runstats_key" > cmd.CommandType = adCmdStoredProc > cmd.CommandTimeout = 3600 > cmd.Parameters.Append _ > cmd.CreateParameter(, adVarChar, adParamInput, 255, > "SESSION.DATA_CUBE_EXTRACT") > Dim rs As ADODB.Recordset > Set rs = New ADODB.Recordset > Set rs = cmd.Execute > > Does anyone have any ideas what might be causing this problem? I can > run the CALL command to runstats myself when at a command line, or from > the control centerl, but from VBA it just doesn't want to work. If > anyone has any alternate ideas for collecting the stats let me know, > but obviously Shell won't work since this is a session table, thus > belonging to the login from excel. > I've never tried to access DB2 from VBA so I can't suggest a solution but I think others would be better able to help if you indicated what error you are getting and where the error originates (VBA? DB2? etc.). -- Rhino |
| |||
| The error comes from VBA, and it really isn't all that descriptive as it is a generic error message from calling the sotroed proc. Basically at this point I am on a quest to find working code for doing a runstats from VBA/VB code. Rhino wrote: > "DW Marker" <dwmarker@yahoo.com> wrote in message > news:1149176792.367318.250090@g10g2000cwb.googlegr oups.com... > >I am attempting to call RUNSTATS_KEY from VBA code and everything looks > > coorect to me, however when I run it, it errors out. The code snippet > > is below... > > > > Set cmd = New ADODB.Command > > cmd.ActiveConnection = conDatabase > > cmd.CommandText = "spinload.runstats_key" > > cmd.CommandType = adCmdStoredProc > > cmd.CommandTimeout = 3600 > > cmd.Parameters.Append _ > > cmd.CreateParameter(, adVarChar, adParamInput, 255, > > "SESSION.DATA_CUBE_EXTRACT") > > Dim rs As ADODB.Recordset > > Set rs = New ADODB.Recordset > > Set rs = cmd.Execute > > > > Does anyone have any ideas what might be causing this problem? I can > > run the CALL command to runstats myself when at a command line, or from > > the control centerl, but from VBA it just doesn't want to work. If > > anyone has any alternate ideas for collecting the stats let me know, > > but obviously Shell won't work since this is a session table, thus > > belonging to the login from excel. > > > > I've never tried to access DB2 from VBA so I can't suggest a solution but I > think others would be better able to help if you indicated what error you > are getting and where the error originates (VBA? DB2? etc.). > > -- > Rhino |
| ||||
| DW Marker wrote: > The error comes from VBA, and it really isn't all that descriptive as > it is a generic error message from calling the sotroed proc. Basically > at this point I am on a quest to find working code for doing a runstats > from VBA/VB code. > Try to call the ADMIN_CMD() procedure. Should work in V8.2. Cheers Serge -- Serge Rielau DB2 Solutions Development IBM Toronto Lab |