#1
  1. Inherits Programmer.Slacker
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Aug 2003
    Location
    Between my Id and your Ego
    Posts
    2,351
    Rep Power
    726

    SQL Server -> AS/400


    Guys, I have a question. I'm trying to connect to an AS/400 using the following script
    Code:
    IF OBJECT_ID('Select * from systables where name LIKE 'ServerName') <> 0 
    	
    	EXEC sp_droplinkedsrvlogin 'ServerName', NULL
    	EXEC sp_dropserver 'ServerName'
    GO
    	EXEC sp_addlinkedserver
     		@server = 'ServerName',
    		@srvproduct = 'Client Access ODBC Driver (32-bit)',
     		@provider = 'IBMDA400',
    		@datasrc = 'LibraryName', --Absolute path excluding filename
    		@provstr = ''
    GO
    
    	EXEC sp_addlinkedsrvlogin 'ServerName', false, NULL, 'UserName', 'Password'
    
    GO
    
    	Exec sp_helpserver 'ServerName'
    
    
    exec sp_helplogins
    Obviously, Names have been changed to protect the innocent . I know this is wrong, but I can't figure it out. Can someone give me a boost here?
    Fisherman

    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein
  2. #2
  3. Inherits Programmer.Slacker
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Aug 2003
    Location
    Between my Id and your Ego
    Posts
    2,351
    Rep Power
    726
    wow... no takers.

IMN logo majestic logo threadwatch logo seochat tools logo