473,383 Members | 1,798 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,383 software developers and data experts.

Bypassing Login Prompt when Opening Linked Table

I read KP article at support.microsoft.com (Q177594) that stated that
with the following code:

Sub Command1_Click()
Dim db1 As Database
Dim db2 As Database
Dim rs As Recordset
Dim strConnect As String

'*** You have to modify the path to where db1.mdb is located
Set db1 = OpenDatabase("C:\MyTest\db1.mdb")
strConnect = UCase(db1.TableDefs("dbo_authors").Connect) & _
";Username=<username>;PWD=<strong password>"
Set db2 = OpenDatabase("", False, False, strConnect)
db2.Close
Set db2 = Nothing
Set rs = db1.OpenRecordset("dbo_authors")
Debug.Print rs(0)
Debug.Print "Recordset Opened Successfully"
rs.Close
db1.Close
Set rs = Nothing
Set db1 = Nothing
End Sub
You can suppress the Pop Up box that prompts the user for the User Name
and Password for the DSN for the Linked Table.

I attemted this code:

Set wk= DBEngine.CreateWorkspace("[APP_NAME]", "Admin", "")
Set db = wk.OpenDatabase(DataLocation & "DB.mdb")

Dim dbTemp As Database
Dim connString As String

connString = UCase(db.TableDefs("[TABLE_NAME]").Connect) &
";Username=[USER_NAME];PWD=[PASSWORD]"

Set dbTemp = wk.OpenDatabase("", False, False, connString)
dbTemp.Close
and the password prompt is still displayed, it is populated but it is
still displayed. If you click OK it connects just fine but it is still
shown.

What am I doing wrong? How do I make it so the password dialog is not
shown.

Thanks,
Jon

Nov 6 '06 #1
1 3395
>How do I make it so the password dialog is not shown.

The following works for me. (The table [GDT_DT_PEOPLE] is a linked
Oracle table.)
Dim cdb As DAO.Database, rst As DAO.Recordset
Dim db2 As DAO.Database, strConnect As String

Set cdb = CurrentDb

strConnect = UCase(cdb.TableDefs("GDT_DT_PEOPLE").Connect) & _
"UID=gdt;PWD=xxx;"
Set db2 = OpenDatabase("", False, False, strConnect)
db2.Close
Set db2 = Nothing

Set rst = cdb.OpenRecordset( _
"SELECT TOP 1 PEOPLE_ID FROM GDT_DT_PEOPLE", _
dbOpenSnapshot)

jdorp wrote:
I read KP article at support.microsoft.com (Q177594) that stated that
with the following code:

Sub Command1_Click()
Dim db1 As Database
Dim db2 As Database
Dim rs As Recordset
Dim strConnect As String

'*** You have to modify the path to where db1.mdb is located
Set db1 = OpenDatabase("C:\MyTest\db1.mdb")
strConnect = UCase(db1.TableDefs("dbo_authors").Connect) & _
";Username=<username>;PWD=<strong password>"
Set db2 = OpenDatabase("", False, False, strConnect)
db2.Close
Set db2 = Nothing
Set rs = db1.OpenRecordset("dbo_authors")
Debug.Print rs(0)
Debug.Print "Recordset Opened Successfully"
rs.Close
db1.Close
Set rs = Nothing
Set db1 = Nothing
End Sub
You can suppress the Pop Up box that prompts the user for the User Name
and Password for the DSN for the Linked Table.

I attemted this code:

Set wk= DBEngine.CreateWorkspace("[APP_NAME]", "Admin", "")
Set db = wk.OpenDatabase(DataLocation & "DB.mdb")

Dim dbTemp As Database
Dim connString As String

connString = UCase(db.TableDefs("[TABLE_NAME]").Connect) &
";Username=[USER_NAME];PWD=[PASSWORD]"

Set dbTemp = wk.OpenDatabase("", False, False, connString)
dbTemp.Close
and the password prompt is still displayed, it is populated but it is
still displayed. If you click OK it connects just fine but it is still
shown.

What am I doing wrong? How do I make it so the password dialog is not
shown.

Thanks,
Jon
Nov 8 '06 #2

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

Similar topics

0
by: Chris Powell | last post by:
I am using Excel/Access 2000 and have two large Excel files (25,000 rows each) that I wish to create linked tables in Access rather than importing into Access. The two source Excel files change...
1
by: Annette Massie | last post by:
I have a database with a linked table within it. I have a query form that opens and allows the user to select criteria and then the form is filled with data found from the linked table. At...
5
by: calaha | last post by:
Hi all, I have been working with this since last night, and can't quite figure out why it's not working. I have a simple login box form that is set to be my startup form in my Access app (upon...
22
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
4
by: antonyliu2002 | last post by:
Let me try to make clear what my concern is. I think it is a pretty interesting one, which I think of while I am developing my web application. I have an authenticated/authorized web...
1
by: xcelmind | last post by:
Hello Dev. Guru, I want to at this time introduce myself. I am Stanley Ojadovwa by name. I’m a freelance and a newbie in web application development. I’m currently using ASP as my application...
1
by: bobmct | last post by:
Again: struggling to convert old-style HTML to html using css. I am trying to create a rectangular box divided into approx three vertical sections. The top section contains an image I would like...
0
by: jxt1303 | last post by:
I've created an Access 2007 application that has linked tables in a SharePoint 2007 site. Normally, after I open the app and access a form that uses one of these linked tables, you are prompted for...
1
by: geetamadhavi | last post by:
Hi All, I have developed a php applciaiton where a new window is opening on checking the whether valid user orntot how to make that in same window after checking i have die(' not valid user ' ); i...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.