Connecting Tech Pros Worldwide Help | Site Map

Can I use MS-SQL Stored Procedures through an ODBC connection?

Lyle Fairfield
Guest
 
Posts: n/a
#1: Nov 12 '05
I created a new MS-SQL Database, "TestODBC".

I made Table1 and StoredProcedure1.

I made an ODBC DSN for that MS-SQL Database.

I created a new AccessXP mdb, "TestODBC".

I linked to the table of the MS-SQL Database, "TestODBC". I wanted to use
StoredProcedure1 as the bound recordsource for a new form Form1. But I
could not find nor link to StoredProcedure1 from the MDB file.

Is there some way that I can bind an Access form in an MDB to a stored
procedure in an MS-SQL database using a ODBC "connection"?

*********

So I went back to the MS-SQL database and made View1 which corresponded to
StoredProcedure1. In the mdb file I linked to View1 as a Table and I was
able to create a form bound to View1. As of yet I have not been able to
have the form display any data, nor is it editable.

Is there some way that I can bind an Access form in an MDB to a view in an
MS-SQL database using a ODBC "connection" and view and edit the data?

*********

So I went to the mdb and created Query1 corresponding to StoredProcedure1
and View1. A form bound to the Query1 worked swimmingly. Is this the
standard way of creating bound forms with an ODBC connection?

What engine is actually doing the work for this query: SQL-Server, ADO,
DAO, something else? Where is it doing the work and how? Is this any
different from where and how a Stored Procedure would do the work?

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Terry Kreft
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Can I use MS-SQL Stored Procedures through an ODBC connection?


1)[color=blue]
> Is there some way that I can bind an Access form in an MDB to a stored
> procedure in an MS-SQL database using a ODBC "connection"?[/color]

Use a pass-through query, this will not be updatable though.

2)[color=blue]
> Is there some way that I can bind an Access form in an MDB to a view in an
> MS-SQL database using a ODBC "connection" and view and edit the data?[/color]

Make sure your table has an Identity column and that this is included in
your view. When you link Access will ask you to identify the key column,
select your Identity column.

3)[color=blue]
> What engine is actually doing the work for this query: SQL-Server, ADO,
> DAO, something else?[/color]
SQL Server, DAO and Access
[color=blue]
>Where is it doing the work and how?[/color]
Depends on how your table is set up, best case scenario is it transfers the
index across the network and then uses that to decide which records to call.
Worst case scenario it transfers the whole table and then sorts/filters
locally.
[color=blue]
>Is this any different from where and how a Stored Procedure would do the[/color]
work?
Yes, a SP will carry out the work on the server and you then get the
resultset back again.

Using methods 1 and 2 more work is carried out on the server and therefore
less data is transfered across the network.


Terry


"Lyle Fairfield" <MissingAddress@Invalid.Com> wrote in message
news:Xns9429407F1C735FFDBA@130.133.1.4...[color=blue]
> I created a new MS-SQL Database, "TestODBC".
>
> I made Table1 and StoredProcedure1.
>
> I made an ODBC DSN for that MS-SQL Database.
>
> I created a new AccessXP mdb, "TestODBC".
>
> I linked to the table of the MS-SQL Database, "TestODBC". I wanted to use
> StoredProcedure1 as the bound recordsource for a new form Form1. But I
> could not find nor link to StoredProcedure1 from the MDB file.
>
> Is there some way that I can bind an Access form in an MDB to a stored
> procedure in an MS-SQL database using a ODBC "connection"?
>
> *********
>
> So I went back to the MS-SQL database and made View1 which corresponded to
> StoredProcedure1. In the mdb file I linked to View1 as a Table and I was
> able to create a form bound to View1. As of yet I have not been able to
> have the form display any data, nor is it editable.
>
> Is there some way that I can bind an Access form in an MDB to a view in an
> MS-SQL database using a ODBC "connection" and view and edit the data?
>
> *********
>
> So I went to the mdb and created Query1 corresponding to StoredProcedure1
> and View1. A form bound to the Query1 worked swimmingly. Is this the
> standard way of creating bound forms with an ODBC connection?
>
> What engine is actually doing the work for this query: SQL-Server, ADO,
> DAO, something else? Where is it doing the work and how? Is this any
> different from where and how a Stored Procedure would do the work?
>
> --
> Lyle
> (for e-mail refer to http://ffdba.com/contacts.htm)[/color]


Closed Thread