|
-
Apr 5th, 2006, 05:54 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Linked tables in MS Access
Hey,
I have a linked(from MS SQL Server 2K5) table in MS Access 2K and I cannot query it because it is asking me for the password everytime.
I do not see an option to save the password in my ODBC connection nor when I link the table.
Please tell me that there's something to do about this ?
Thanks
Last edited by sebs; Apr 6th, 2006 at 06:43 AM.
-
Apr 5th, 2006, 05:56 PM
#2
Re: Linked tables in MS Access
I can't remember what stage of the process it is, but the option is there as part of the linking process - I'm pretty sure it is a tick-box at the bottom of one of the screens that you go thru.
-
Apr 5th, 2006, 06:12 PM
#3
Re: Linked tables in MS Access
Yes, there should be the option when you create the link. I believe its a checkbox that you need to check.
It may also be in your ODBC datasource connection that you specified during the linking.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 6th, 2006, 06:42 AM
#4
Thread Starter
Frenzied Member
Re: Linked tables in MS Access
Geez, that's what I've been reading on the net, but I double triple checked and I cannot see that damm option 
I have read somewhere that you could store the password in the tabledef of the linked table, does that make sense ??
Thanks for your help
-
Apr 6th, 2006, 07:17 AM
#5
Thread Starter
Frenzied Member
Re: Linked tables in MS Access
Small update !
I created my own dsn, now when I select it in the dsn list, I do not get prompt for my password, but as soon as I close MS Access and reopen it, I get prompt for it again.
If I look in MSysObjects and I look at the Connect field, it saves everything BUT the password.
Where can I save it ? Can I do this with Access 2000 ?
Thanks
-
Apr 6th, 2006, 07:33 AM
#6
Re: Linked tables in MS Access
I think you need to use the "Linked Table Manager" (under "Tools"->"Database Utilities"), rather than simply selecting "Link tables..".
Unfortunately I cant test as I haven't got that installed at the moment, and dont have permissions with this user account to install it.
-
Apr 6th, 2006, 07:37 AM
#7
Thread Starter
Frenzied Member
Re: Linked tables in MS Access
Nah, it asked me for the password and when I put it in, it just refreshed the table.
I need to be able to query the database thru asp.
I found this piece of code:
VB Code:
Option Compare Database
Public Sub ChangeConnection(ByVal TableName As String, ByVal ConnectionInfo As String)
'Dim db As DAO.Database
'Dim tdf As DAO.TableDef
Set db = CurrentDb
Set tdf = db.TableDefs(TableName)
'Change the connect to what you need for your connection.
MsgBox tdf.connect
tdf.connect = ConnectionInfo
MsgBox tdf.connect
Set tdf = Nothing
db.Close
Set db = Nothing
End Sub
Sub test()
Call ChangeConnection("ve_forms", "connection string here")
End Sub
and I can see the new connection string on my second msgbox, but as soon as the code is doen running, it goes back to the previous string
-
Apr 6th, 2006, 07:51 AM
#8
Re: Linked tables in MS Access
Have you tried removing the linked table(s) first, then running Linked Table Manager?
-
Apr 6th, 2006, 08:40 AM
#9
Thread Starter
Frenzied Member
Re: Linked tables in MS Access
Yeah, I just tried, it says that there's no linked tables
-
Apr 6th, 2006, 08:56 AM
#10
Thread Starter
Frenzied Member
Re: Linked tables in MS Access
FINALLY !
I figured it out, I used some of the code I had to backup our sql database.
Anyway, the trick is to create the link from code:
VB Code:
DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;DRIVER=SQL Server;UID=**;PWD=**;SERVER=**;APP=Microsoft Data Access Components;", acTable, TableName, TableName, False, True
and it store the full connection string and when I re-open my db, I do not have to enter the password !
I am so happy right now, thanks for your help si_the_geek and RobDog888.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|