A
Anon
Hi,
I am using an ADP project and I have a procedure that is altered each time
to display a grid as a result of the DoCmd.OpenStoredProcedure command
(because there was no other way to pass parameters from controls on the form
to the sub). The code is as follows:
stDocName = "adhocquery"
CurrentProject.Connection.Execute "drop procedure " & stDocName
CurrentProject.Connection.Execute "alter procedure " & stDocName & " as
begin " & vbCrLf & Me.Text0 & vbCrLf & " end"
DoCmd.OpenStoredProcedure stDocName, acViewNormal, acReadOnly
Now the problem is that whenever I execute the proc the sub always shows the
results grid from the first alteration of the proc. What I mean is that upon
successive alter commands, the results grid does not reflect the changes. I
am new to access and I would really appreciate it if some can help me out
here.
P.S. I am trying to allow a user to execute ad hoc queries as ADP does not
allow the execution of a sql query without first saving it as a stored
procedure or a view or function, which I is not what the client needs to do.
Is there any other way of executing queries and looking up the results in
grid using ADP.
I am using an ADP project and I have a procedure that is altered each time
to display a grid as a result of the DoCmd.OpenStoredProcedure command
(because there was no other way to pass parameters from controls on the form
to the sub). The code is as follows:
stDocName = "adhocquery"
CurrentProject.Connection.Execute "drop procedure " & stDocName
CurrentProject.Connection.Execute "alter procedure " & stDocName & " as
begin " & vbCrLf & Me.Text0 & vbCrLf & " end"
DoCmd.OpenStoredProcedure stDocName, acViewNormal, acReadOnly
Now the problem is that whenever I execute the proc the sub always shows the
results grid from the first alteration of the proc. What I mean is that upon
successive alter commands, the results grid does not reflect the changes. I
am new to access and I would really appreciate it if some can help me out
here.
P.S. I am trying to allow a user to execute ad hoc queries as ADP does not
allow the execution of a sql query without first saving it as a stored
procedure or a view or function, which I is not what the client needs to do.
Is there any other way of executing queries and looking up the results in
grid using ADP.