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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to Oracle. Prompts for DSN driver but its already provided

Status
Not open for further replies.

Kozia

Programmer
Sep 9, 2002
18
0
0
CA
I have a code as follows:
Dim strConnect As String
Dim strMsg As String
Dim db As Database
Dim tdfLocal As TableDef
Dim varTblArray As Variant
Dim varTblItem As Variant

Dim conn As ADODB.Connection
Dim rstmat As ADODB.Recordset
Dim strc As String
Dim count As Double

Set conn = New ADODB.Connection 'Define new ADO connection
Set rstmat = New ADODB.Recordset

counter = 1

strc = "DSN=ORATST0;UID=BLINK;DBQ=tst0;ASY=OFF;PWD=PASS"
With conn
.CursorLocation = adUseClient '
.ConnectionString = strc
.Open 'Open connection
End With

Set db = CurrentDb


'iterate throught the hard coded tables
varTblArray = Array("BUDLINK_SUPERVISOR")
For Each varTblItem In varTblArray
'reconnect
Set tdfLocal = db.TableDefs(CStr(varTblItem))
With tdfLocal
.Connect = conn
.RefreshLink
End With
Next varTblItem

End Sub

When it hits the .Refreshlink opens a window prompting me for DSN but DSN is already provided on line:


strc = "DSN=ORATST0;UID=BLINK;DBQ=tst0;ASY=OFF;PWD=PASS"

How can I getrid of it???? Please help its urgent. Thanks
 
I may be wrong, but at a glance it looks like you're looping thru your collection of tables. Which I'm assuming are linked tables. If this is so, then try deleting the link to the Oracle table, relink it, and this time check the box that says, SAVE PASSWORD. (If you have already done this...Never mind)
 
I used to get this with SQL Server linked tables but I installed the latest MDAC and it resolved the issue. Have you done that?
 
Thanks. I solved the problem though
I put .Connect = strc

That did the trick for me
Thanks anyways.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top