Showing posts with label clicking. Show all posts
Showing posts with label clicking. Show all posts

Wednesday, March 21, 2012

RUN SQL Stored Procedure in Access

Hi there
I have a SQL stored procedure which I would like to run through Access.
This procedure has a paramert.
I created a form and by clicking a buttom I want to run this procedure but before to be able to input the parametr as well.

I am not sure if there is any way I can do this in the Access interface or wherther I have to use VBA code(which I am not familiar with)

Thank you very much.
Regards.
Pete

Quote:

Originally Posted by petr_podskubka

Hi there
I have a SQL stored procedure which I would like to run through Access.
This procedure has a paramert.
I created a form and by clicking a buttom I want to run this procedure but before to be able to input the parametr as well.

I am not sure if there is any way I can do this in the Access interface or wherther I have to use VBA code(which I am not familiar with)

Thank you very much.
Regards.
Pete

I would like to know if you would have information I trying to find information on how can I have my SQL stored procedure through Access...

Thank you for helping

|||

Quote:

Originally Posted by petr_podskubka

Hi there
I have a SQL stored procedure which I would like to run through Access.
This procedure has a paramert.
I created a form and by clicking a buttom I want to run this procedure but before to be able to input the parametr as well.

I am not sure if there is any way I can do this in the Access interface or wherther I have to use VBA code(which I am not familiar with)

Thank you very much.
Regards.
Pete

it will be a little bit of both...you need the VBA to establish connection and some setting. although there are objects that can handle some of these tasks, you still might need some VBA coding to handle some stuff, ie, error handling.

|||Try this:

http://archives.postgresql.org/pgsq...05/msg01260.php

Basically what it does, it changes text of your query every time you pass parameters.
The best part it is ready to use you dont need to write it yourself.

Good Luck.

Irina.|||

Quote:

Originally Posted by petr_podskubka

Hi there
I have a SQL stored procedure which I would like to run through Access.
This procedure has a paramert.
I created a form and by clicking a buttom I want to run this procedure but before to be able to input the parametr as well.

I am not sure if there is any way I can do this in the Access interface or wherther I have to use VBA code(which I am not familiar with)

Thank you very much.
Regards.
Pete




Look at ADP files in Access stored procedures are exposed in the GUI interface along with views you enter paramters for the stored procedure via the Forms Inputparameters property of the form

Regards

Jim

|||

Quote:

Originally Posted by Jim Doherty

Look at ADP files in Access stored procedures are exposed in the GUI interface along with views you enter paramters for the stored procedure via the Forms Inputparameters property of the form

Regards

Jim

As I understood this question it is a pass through query that runs on SQL Server side and not on Access side.

|||

Quote:

Originally Posted by iburyak

As I understood this question it is a pass through query that runs on SQL Server side and not on Access side.



Hi Iburyak,

You're probably right of course and me way off the mark at the end of the day :)... but the poster simply mentioned 'Access' and my presumption is that they might not be aware that in Access .ADP files as distinct from mdb files were intended to work directly with SQL Server. The connection method is (universal data link) automated within the interface they might want to consider their options?

Regards

Jim

Tuesday, March 20, 2012

Run report after parameter selected

My report has a Date parameter. Can the report be run automatically after the date is changed without clicking on View Report button?

Thanks

I don't think it can. The toolbar is generated by the reportserver and you can't hook into any events and there is no Autorun option to my knowledge.

The only hack I can think of is displaying the report in a custom page, view the source to find out the ids/names that RS assigns to your parameters and the name of the js function called when the "View Report" button is pressed. You then write some javascript that hooks into the onChage event of the dropdown and simulate the pressing of the button by calling the relevant function manually.

Like I said that is a real hack and is not likely to be very flexible but you could experiment. Eaither way you can't modify the Report Manager to do this you would have to write a custom page.

Monday, March 12, 2012

Run in Query Window in Management Studio

I thought we could run sqlcmd commands directly in the Query Editor within
Management Studio by clicking on the SQLCMD mode
So for example I tried this
sqlcmd -d userdb -i test.sql
in the query editor and it failed. However it succeeds when I run it from
the command prompt
Thankssqlcmd is not a sqlcmd command. It is a command understood by the *Operating System* command
interpreter, which *starts* sqlcmd. SSMS does understand sqlcmd commands, like :r and :Connect
provided you set SSMS in that mode (check the Query menu).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Hassan" <hassan@.test.com> wrote in message news:OTiUrmrOIHA.4712@.TK2MSFTNGP04.phx.gbl...
>I thought we could run sqlcmd commands directly in the Query Editor within Management Studio by
>clicking on the SQLCMD mode
> So for example I tried this
> sqlcmd -d userdb -i test.sql
> in the query editor and it failed. However it succeeds when I run it from the command prompt
> Thanks

Run in Query Window in Management Studio

I thought we could run sqlcmd commands directly in the Query Editor within
Management Studio by clicking on the SQLCMD mode
So for example I tried this
sqlcmd -d userdb -i test.sql
in the query editor and it failed. However it succeeds when I run it from
the command prompt
Thankssqlcmd is not a sqlcmd command. It is a command understood by the *Operating
System* command
interpreter, which *starts* sqlcmd. SSMS does understand sqlcmd commands, li
ke :r and :Connect
provided you set SSMS in that mode (check the Query menu).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Hassan" <hassan@.test.com> wrote in message news:OTiUrmrOIHA.4712@.TK2MSFTNGP04.phx.gbl...[vb
col=seagreen]
>I thought we could run sqlcmd commands directly in the Query Editor within
Management Studio by
>clicking on the SQLCMD mode
> So for example I tried this
> sqlcmd -d userdb -i test.sql
> in the query editor and it failed. However it succeeds when I run it from
the command prompt
> Thanks[/vbcol]

Saturday, February 25, 2012

Rules and defaults

Hi,

Can any one provide me information on creating rules and defaults in SQL Server2005, when i tried right clicking rules or defaults in management studio instead of new option i'am getting only refresh option.

This feature was working smoothly in sql2000.....I'am trying this on Microsoft SQL Server2005 Standard Edition.

thanks in advance

Mat

Rules and defaults are deprecated in 2005. You should now use constraints, which you define in the table designer. Rules and defaults are still supported, but you have to create them manually by writing the code yourself. You cannot create them in Management Studio because you should not be using them any more.

This comes from the 2000 documentation
"Rules are a backward-compatibility feature that perform some of the same functions as CHECK constraints. CHECK constraints are the preferred, standard way to restrict the values in a column."
"Defaults, a backward compatibility feature, perform some of the same functions as default definitions created using the DEFAULT keyword of ALTER or CREATE TABLE statements. Default definitions are the preferred, standard way to restrict column data because the definition is stored with the table and automatically dropped when the table is dropped."

And this from the 2005 documentation
"CREATE RULE will be removed in a future version of Microsoft SQL Server. Avoid using CREATE RULE in new development work, and plan to modify applications that currently use it. We recommend that you use check constraints instead."
"CREATE DEFAULT will be removed in a future version of Microsoft SQL Server. Avoid using CREATE DEFAULT in new development work, and plan to modify applications that currently use it. Instead, use default definitions created using the DEFAULT keyword of ALTER TABLE or CREATE TABLE."