Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing connection strings for Oracle

Status
Not open for further replies.

itmasterw

Programmer
Apr 13, 2003
147
US
Hi, I have been working mostly with SQL server, but now will be working this Oracle. I was wondering if someone can teel me waht VB6 Connection strings and select statements would look like for Oracle. For example how would I do the following in Oracle. Thank You

Public adoConnect As ADODB.Connection
Public adoRecordset As ADODB.Recordset

Set adoConnect = New ADODB.Connection
adoConnect.ConnectionString = "Provider=SQLOLEDB;Data Source=;Initial Catalog=Sales;Integrated Security=SSPI;Persist Security Info=False;"

Set adoRecordset = New Recordset
adoRecordset.Open "Select * from Orders", _
adoConnect, adOpenStatic, adLockOptimistic


Set txtID.DataSource = adoRecordset
txtID.DataField = "cust_ID"


 

There is an example under Oracle, ole db connection, for operating system authentication, which I think is the same as what you are doing with SQL Server here. I have never used OS auth with Oracle from VB or .net, though...

Mark [openup]
 
I have just noticed that you cross-posted this same question in the VB6 forum.

That is bad...

Mark [openup]
 
Ho I am sorry I was not sure where this uestion fell into, and I did not know that there would be anything wrong with doing that. However, in regard to you post I saw something on a web site, I do not know if it is right or not, but it had a number of things that was different and I did not know whaat they ment. It looks like this.
Connect to Oracele server begin

Conn = "DRIVER={ORACLE ODBC DRIVER};SERVER=Service name;UID=username;PWD=password;DBQ=Service name;DBA=W;APA=T;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;FRL=F;MTS=F;CSR=F;PFC=10;TLO=O;"
Thank You
 
Hi
I guess if you want to ask the same question in two forums, you could reference the other post in both. Also, if someone satisfactorily answers your question in another forum, you should post back and tell people that you have an answer.

There are no hard and fast rules - it is just that if you try to be extra polite, you will generally find people go a little bit more to help you. Most posts on here are answered, and then the person who asked the question never bothers to reply, for example.

Anyways, as I said I have not used OS auth to Oracle from vb before, but it looks like from your SQL Server connection string that you do want to use this? Also, your SQL server connection string uses oledb rather than ODBC.

If so, then the closest equivalent in Oracle will be

"Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;OSAuthent=1;"

This is from the web site I mentioned in my previous post.

Good luck.


Mark [openup]
 
Thank You and I do appreciate you insight on how to handle post. I really do want to be disrespectful to anyone, and therefore I really do appreciate thoughts and help here. I will be careful in the future; and thanks for the additional information on the subject.

Thank You
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top