DNS-LESS Connection to AS/400

lmonaghan

Board Regular
Joined
Nov 27, 2004
Messages
84
My IT department has been trying to figure out a way to use a DNS-less connection so that Excel 2003 files can be deployed across the company without having to configure an ODBC in the control panel.

We have searched numerous websites for the syntax, but cannot seem to get it to run. We can establish a connection by using the following code:

Code:
Dim ConStr

Set con1 = CreateObject("ADODB.Connection")
ConStr = ""
ConStr = ConStr & "Driver=Client Access ODBC Driver (32-bit);"
ConStr = ConStr & "System=10.1.1.10;"
ConStr = ConStr & "UID=NET;"
ConStr = ConStr & "PWD=netgti;"
con1.Open ConStr
MsgBox "Connection Opened!"

However, when we try to incorporate the connection string, I get a Run-time error: '1004' error.

Code:
SQL = "SELECT omnidata.omeyadlm.alusr as PLANNER, omnidata.omeyuser.eyname as NAME " & _
    "FROM omnidata.omeyadlm, omnidata.omeyuser " & _
    "WHERE omnidata.omeyadlm.alusr = omnidata.omeyuser.eyid " & _
    " AND omnidata.omeyadlm.alid='PLANNERS' " & _
    "ORDER BY omnidata.omeyadlm.alusr "

    With ActiveSheet.QueryTables.Add(Connection:="ODBC;Driver={Client Access ODBC Driver (32-bit)};System=10.1.1.10;Uid=NET;Pwd=netgti;" _
        , Destination:=Range("A1"))
        .CommandText = SQL
        .Refresh
    End With

Please help us! Any suggestions??? :confused:
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
I have both sets of code to see if I can get connected to that server and it seems to work. On a separate note, I am trying to use similar path, user id, password, etc. to connect and I can't get it to work. I'll look over your link to see if I can make some sense of it.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,215,051
Messages
6,122,871
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top