Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 16th, 2005, 11:23 AM
Registered User
 
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Linked Tables using file DSN

I'm having trouble maintaining a linked table to SQL Server using a file DSN. When I first create the linked table I can view the data, but if I close the DB I lose the connection. Any further attempts to view data result in a ODBC-Connection failure (3151). The only way to re-establish a connection is to refresh the links either programmatically or with the linked table manager. The only time I don't have an issue with file DSNs is if I "use a trusted connection", but in this case I need to use SQL Authentication.

I think it may have something to do with the DSN not remembering the password. If you look at the .dsn file it does not mention the password at all.

If anyone know how to deal with this without using a function to re-link or re-create the tables I would be most appreciative.

 
Old February 16th, 2005, 12:27 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I use a system dsn instead of a file dsn to maintain the connection. If you do not select trusted connection, sql will prompt you for the username and password each time you make your first connection to the sql server.

You can use code to establish a system dsn, and disconnect it, from within the database if you want.


mmcdonal
 
Old February 16th, 2005, 02:05 PM
Registered User
 
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So will it prompt for a password when you use a sytem DSN (not trusted connection) or is there a way around that.

I guess I just don't understand why it won't maintain password information even though you specify it when you create the dsn.

Quote:
quote:Originally posted by mmcdonal
 I use a system dsn instead of a file dsn to maintain the connection. If you do not select trusted connection, sql will prompt you for the username and password each time you make your first connection to the sql server.

You can use code to establish a system dsn, and disconnect it, from within the database if you want.


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked Tables edojan Access 1 July 20th, 2006 10:49 AM
Finding linked tables elansolutionsltd Access VBA 4 January 16th, 2006 11:00 PM
Linked Tables ru1 Access 1 September 21st, 2005 07:24 AM
Linked Tables ricmar Access VBA 6 July 28th, 2004 05:08 PM
Access Linked Tables StephenDID Access ASP 6 October 6th, 2003 10:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.