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

ADODB Connection String - Prompt for Password?

I'm starting to work with connection strings and Oracle. The connection
string syntax is pretty much the same as MS SQL (based on one of Lyle's
posts in response to a question I had about a jmonth or more ago), but
now I'm wondering how to get a procedure using a connection string to
prompt the user for a password. For example, the standard connect
string might be:

Driver={Microsoft ODBC for Oracle};Server=Timmy;Uid=tmar;Pwd=rtma

In my DAO methods for passthrough queries, I would always have the DAO
connection string saved as a constant in a standard module.

But in an app I might have two user names - one would a read only user,
the other has full access. I would want the connection string for the
ful access user to NOT have the password. When I did something similar
in DAO methods, the app would prompt the user for the password with the
DSN dialog box.

I've tried:

Driver={Microsoft ODBC for Oracle};Server=Timmy;Uid=tmar

Driver={Microsoft ODBC for Oracle};Server=Timmy;Uid=tmar;Pwd=

And these throw errors. Any suggestions? Thanks very much in advance.+
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #1
3 15159
Hi, Tim.

I have used the following under ADO:

Set oCon = CreateObject("ADODB.Connection")
oCon.Properties("Prompt") = 2 ' adPromptComplete
oCon.ConnectionString = "DSN=" & strDSN & ";"
oCon.Open

Try specifying UID and omitting PWD completely.
Gord

Nov 13 '05 #2
Gord wrote:
Hi, Tim.

I have used the following under ADO:

Set oCon = CreateObject("ADODB.Connection")
oCon.Properties("Prompt") = 2 ' adPromptComplete
oCon.ConnectionString = "DSN=" & strDSN & ";"
oCon.Open

Try specifying UID and omitting PWD completely.


Thanks Gord, I will give this a try.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #3
Try something like this:

sub ConnectToOracle()
Dim Pwrd As String
...
Pwrd = InputBox("Please enter your password", "Password")

Driver={Microsoft ODBC for Oracle};Server=Timmy;Uid=tmar;Pwd=" & Pwrd
...
End Sub
Rich

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #4

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

Similar topics

2
by: Luis | last post by:
I'm using a connection string in my asp pages similar to: cst = "Provider=SQLOLEDB;Server=MyServerName;Database=MyDbName;" cst = cst & "Network Library=DBMSSOCN;User ID=MyUserid;Password=MyPass"...
1
by: Nigel C | last post by:
Access 2000 - A am trying to access another Access 2000 database from a code module. I have seen examples of the ADODB connection string - to connect to an access database however the database...
5
by: Dmitry Karneyev | last post by:
Hi All! I've got an ado.net app with several win forms. In the first form (form1) I connect to DB and in other forms I use connection string generated by the form1 and stored in sqlconnection...
4
by: msnews.microsoft.com | last post by:
How can I call connection string (database) builder dialog?
2
by: MasterChief | last post by:
I have a OLEDB Connection String that is working very well for me. My question is that I read that you can store the Connection String in a seperate include file or somewhere else. I am just...
2
by: AVB | last post by:
We are working on a web services app and a windows form app. This is distrubited with .net ClickOnce and has been developed with 2.0 FrameWork and written in C#. I can search for the application...
1
by: Sankalp | last post by:
Hi, I am using VB 2005. My application has many data bound controls. The connection is stored in the app.config file. I want the application to start with a default connection string and while...
13
by: Jennifer.Berube | last post by:
well I'm not sure how to go about making my SQL connection string... The code below is what I need to replace with my SQL connection...I just don't know if that code is for DSN or access... I...
5
by: Onetoomany | last post by:
Hi, I've just upgraded to Small Business Server 2008, 64 bit. My website, which worked perfectly before, is having issues with the connection string: I've tried: 1) sConnection =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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...
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.