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!

DSN-Less Connection

Status
Not open for further replies.

cid

Programmer
Jan 4, 2001
18
US
I need to get some help with a connection string for a DSN-less ORACLE connection. Everything I've found points to Access. C'mon, how many people still use Access? Sheesh!

Anyway, any help would be appreciated! Thanks in advance. ~[ cid ]~

web // email // cid@ciddivine.com
aim // ciddivine
 
Looks pretty simple, but this worked for me a few years ago with an Oracle 7.3 database:

sConnString = "UID=logonid;"
sConnString = sConnString & "PWD=password;"
sConnString = sConnString & "DRIVER={Microsoft ODBC for Oracle};"
sConnString = sConnString & "SERVER=servername;"

ADOConn.Open sConnString

 
Cid:

I do the following just to make certain everything is okay.

Dim cn
Dim rs
Set cn = createObject("ADODB.connection")
cn.Open "Provider=MSDAORA;Data Source=Alias;User ID=UserName;Password=PWD"

Set rs = createObject("ADODB.Recordset")

Dim SQLString
' two fields from a table
SQLString = "select headline, priority from defect"

rs.Open SQLString, cn
adStateOpen = 1
If cn.State = adStateOpen Then
MsgBox "opened oracle"
End If
rs.MoveFirst
' as a second check
Dim i
i = 0
s = "start"
Do While i < 6
' msgbox rs(0).Value & &quot; &quot; & rs(1).value
s = s & rs(0).Value & &quot; &quot; & rs(1).value & vbcrlf
i = i + 1
rs.MoveNext
Loop
msgbox s
rs.Close
cn.Close

Hope this helps,

Parke
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top