473,387 Members | 1,638 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ODBC connection strings won't update

DFS
This code fails to update the connection strings (Access97 - SQL Server 2000
table links). It works in Access2000.

Public Sub updateConnStrings()
For i = 0 To db.TableDefs.Count - 1
Set td = db.TableDefs(i)
td.Connect = "ODBC;DSN=dsnName;UID=DFS;PWD=DFSpw"
td.RefreshLink
Next i
db.TableDefs.Refresh
End Sub
Nov 12 '05 #1
3 4353
On Mon, 26 Jan 2004 22:41:12 -0500, "DFS" <no****@nospam.com> wrote:

I think you need to add the tablename to the Connect string. Attach
one manually, then check what the Connect string is.

-Tom.

This code fails to update the connection strings (Access97 - SQL Server 2000
table links). It works in Access2000.

Public Sub updateConnStrings()
For i = 0 To db.TableDefs.Count - 1
Set td = db.TableDefs(i)
td.Connect = "ODBC;DSN=dsnName;UID=DFS;PWD=DFSpw"
td.RefreshLink
Next i
db.TableDefs.Refresh
End Sub


Nov 12 '05 #2
I don't recall that I've ever had to include the table name in the connect
string. Personally, I can't see any reason the code below should not work,
though I'm not sure why an index number was used instead of a For Each loop.

On Mon, 26 Jan 2004 22:09:11 -0700, Tom van Stiphout <to*****@no.spam.cox.net>
wrote:
On Mon, 26 Jan 2004 22:41:12 -0500, "DFS" <no****@nospam.com> wrote:

I think you need to add the tablename to the Connect string. Attach
one manually, then check what the Connect string is.

-Tom.

This code fails to update the connection strings (Access97 - SQL Server 2000
table links). It works in Access2000.

Public Sub updateConnStrings()
For i = 0 To db.TableDefs.Count - 1
Set td = db.TableDefs(i)
td.Connect = "ODBC;DSN=dsnName;UID=DFS;PWD=DFSpw"
td.RefreshLink
Next i
db.TableDefs.Refresh
End Sub


Nov 12 '05 #3
DFS
"Tom van Stiphout" <to*****@no.spam.cox.net> wrote in message
news:ei********************************@4ax.com...
On Mon, 26 Jan 2004 22:41:12 -0500, "DFS" <no****@nospam.com> wrote:

I think you need to add the tablename to the Connect string. Attach
one manually, then check what the Connect string is.
Tom,

Adding the tablename didn't affect it. Turns out my code is working, sort
of.

RefreshLink in Access 97 doesn't update the Connect string to exactly what I
say; it will change the DSN, UID and DATABASE, but it adds (or won't drop)
the WSID, the App=MicrosoftAccess, and the Trusted_Connection settings.

Access 2000 sets the Connect string to whatever you say (as long as it's
valid). So you can have a minimal Connect string in A2000:
ODBC;DSN=ProductionSystem;DATABASE=ProductionDB

Thanks

-Tom.

This code fails to update the connection strings (Access97 - SQL Server 2000table links). It works in Access2000.

Public Sub updateConnStrings()
For i = 0 To db.TableDefs.Count - 1
Set td = db.TableDefs(i)
td.Connect = "ODBC;DSN=dsnName;UID=DFS;PWD=DFSpw"
td.RefreshLink
Next i
db.TableDefs.Refresh
End Sub

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sean Anderson | last post by:
ODBC under System DSN Setup Access Driver give it the DSN (Data Source Name) MSA Click on Select and point to the myfile.mdb (your database file)
6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
1
by: Nolan | last post by:
I have created an ODBC connection to our Teradata database. Whenever I attempt to link to a table on Teradata the process seems to be working. But then I get the error message, "Reserved error...
1
by: RLN | last post by:
RE: Access 2003 using WinXP SP2 Problem: When I start up my app I double click either one of my two Oracle tables in the table list, it asks for an id and pass. I need them to be linked at...
1
by: cindy | last post by:
this is the call private void Page_Load(object sender, System.EventArgs e) { OdbcConnection connection = new OdbcConnection ("DSN=PFW52"); CreateDataAdapter(connection); } this is the code,...
2
by: mike11d11 | last post by:
Our company has a collection system with a list of accounts in it, I connect to this system with access using an ODBC connection. I pull in the account #'s and other fields, then I have to run and...
3
by: nolanmadson | last post by:
I'm creating a front-end for some Teradata user maintenance tables in MS Access. I've started having problems in occasionally not being able to insert or update records in these tables. I've been...
7
by: BillCo | last post by:
I need to Connect to an online mySQL database from Access using JET ODBC with no saved DSN. Anyone out there who as made this work and can give example of how it's done? I've seen lots of posts...
5
by: insomniux | last post by:
Hi, I need to install an ODBC driver for a database, but our system- administrator does not allow me to install it on the VPN-server. Is there a way to install an ODBC driver for a separate user....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.