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 bkrike 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"








 
Hi,

It should be almost exactly the same, you will only need to change the ConnectionString to (with your own values in obviously [smile]):
Code:
"Provider=;Password=;User ID=;Data Source=;Persist Security Info=True"
Hope this helps

Harleyquinn

---------------------------------
For tsunami relief donations
 
Hi,

Simple select statements like the one mentioned in your post will be fine in Oracle. When the queries become more complex there are functions available in Oracle that are not available in SQLServer and vice versa.

It might be worth getting a book on Oracle SQL if this going towards the more complex queries.

Hope this helps

Harleyquinn

---------------------------------
For tsunami relief donations
 
Private Sub ConnectToDatabase()
Dim ConnectionString As String
Dim UserID As String
Dim Password As String

Call GetProfile(ConnectionString, UserID, Password)
Set cn = New ADODB.Connection

With cn
.CommandTimeout = 3
.CursorLocation = adUseServer 'adUseClient
.Provider = "MSDAORA" '"OraOLEDB.Oracle"
End With

cn.Open ConnectionString, UserID, Password, adAsyncConnect

End Sub

Private Sub GetProfile(ByRef strConnectionString As String, _
ByRef strUserID As String, _
ByRef strPassword As String)

strConnectionString = "Your Schema Name"
strUserID = "Your User ID"
strPassword = "Your Password"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top