Jumat, 29 Juni 2012

[MS_AccessPros] Re: Pass through queries

 

Hi Sam,

You can use an unnamed and unsaved temporary Passthrough Querydef which is a method recomended by Microsoft. When your procedure ends the unnamed QueryDef is destroyed.

You can use a simeple custom function that produces the connection string for the QueryDef. If you use a mde or accde file or lock your code Project your user is unlikely to even know your Procedure exists.

You may find an article I wrote helpful. It applies to SQL Server as well as SQL Azure and it uses Passthrough action queries. Although it is about creating logins it works the same as Passthrough queries. It is entitled "How to Use Microsoft Access to Create Logins in a SQL Azure Database"
http://gainingaccess.net/Articles/HowToCreateSQLAzureLogins.aspx

Kind Regards,
Patrick Wood
Microsoft Access MVP
Gaining Access Technologies Founder
http://gainingaccess.net
Microsoft Access and SQL Azure Information Center for Developers:
http://gainingaccess.net/SQLAzure/AccessAndSQLAzureInfo.aspx

--- In MS_Access_Professionals@yahoogroups.com, "sarmbraugh" <sarmbraugh@...> wrote:
>
> I am trying to convert some code that was running against Jet to run with SQL Server tables, and I have a couple questions about pass through queries. Any thoughts are appreciated.
>
> - I ran Doug Steele's code for creating DSN-less connections (http://www.accessmvp.com/DJSteele/DSNLessLinks.html). Seems to work great, but when I test pass through queries in the query builder I'm getting a pop-up asking for a DSN. I'm using SQL Server authentication and thinking maybe the password isn't stored, but then there has to be some way to run queries without being prompted for the password every time, right?
>
> - Some code I'm converting has lots of action queries without query definition objects. An example could be something like
> ssql = "Delete * from dbo_SomeTable"
> db.execute(ssql)
>
> My understanding is that the syntax of that SQL statement has to be changed to "Delete from dbo.SomeTable", which works when defined as a pass through query in the query builder (after prompting for the DSN). But is there a way to modify this in code, hopefully without creating query defs?
>
> Thanks,
> Sam
>

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar