Create a view of AS400 table using ODBC

I am trying to move my BE to SQL Server and use MSAccess as FE. After reading some I understand that I want to do most of the work on the BE instead at each station therefore improving speed in the office as well as our satellite offices. That being said I need to either link an MS SQL Server table to some in Access or create a view of the AS400 table. I am new to MS SQL Server so any help would be greatly appreciated even suggestions.
LVL 1
JArndt42Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
BAKADYConnect With a Mentor Commented:
question. Does the DSN have to be on the machine that SQL Server is on?
YES... OMG!!!!

- Windows Server with installed and running SQL-Server and Client Access 32-Bit ODBC Driver
- and AS400 (IBM iSeries) with a user for this proposes

i think i write this twice or more times ...
just these both machines... where did you create the dsn...??? at your own workstation...???

if this is the case... sorry dude, but you need to explain me how the sql-server get access to your workstation to use it....

forgot your workstation... shut it down... work at your server...
0
 
BAKADYCommented:
i need more information...

how do you want to transfer your data?

AS400 (BE) ==> MS SQL (BRIDGE) ==> Access (FE)

Regards
0
 
JArndt42Author Commented:
What I was thinking is that I would like to create views in MS SQL. For instance I have a table in AS400 that has the carrier information. I will have some tables in MS SQL that will have other information that is NOT in AS400 such as traffic lanes. Currently I have that table in Access and use the pass through along with the other table to create a query. What I want to know is if there is a way to get the information from AS400 into MS SQL so I can create a view much like the query I now have in Access. The ultimate goal is to do all of the processing on the BE, MS SQL, to reduce network traffic therefore making the FE faster.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
BAKADYCommented:
it seams to be like my own actually project....

we have a ERP in AS400, with stored procedures our MSSQL-Server calls/copies the data from AS400 and generates there some reports, users call/display this info using Pivot-Tables and Charts in EXCEL.

is that likely what you need???

Sorry bad english...   :(
0
 
JArndt42Author Commented:
yes it sounds like what I need. so basically you have a stored procedure that you have that gets the information from AS400? How do you do that?
0
 
BAKADYCommented:
Your requirements to Connect AS400 and MSSQL:

- IBM iSeries Server with opened ports to connect to it with Client Accees 32-bit ODBC Driver
- An enabled AS400 user for login
- Windows Server 2003/2008 64-bit with followed installed software:
- MS SQL Server 2005/2008 R2 (no express editions)
- Client Access 32-Bit ODBC-Driver

Ready???
0
 
JArndt42Author Commented:
I have everything except for one thing. I am using MS SQL Server 2000. Will that affect it?
0
 
Jim P.Commented:
SQL 7 and above can do an openquery method to an AS400 to read data as long as the driver is loaded on the SQL Server. Changing the data on the AS400 is a different animal.

For instance I have a table in AS400 that has the carrier information.

I figure that such info is pretty static; maybe only changing once a day. So I would create a table that mimics the AS400 table.

Then create a linked server to the AS400 and import the data to the local table.

The stored proc would be like:
Create Procedure dbo.RefreshCarrierTable
As
Begin
DELETE FROM CarrierTable

INSERT INTO CarrierTable
SELECT * FROM LinkedCarrierTable
End

Open in new window


Run that at 6AM every morning.

Some info on linking to the AS400:
http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/0e68f512-1e19-4c50-b343-219085d70076
0
 
BAKADYCommented:
I don't work with SQL 2k since 5 years, but jimpen is right...your need to add a linked server at SQL server.

But first create a System-DSN in ODBC-Manager which connect to AS400... Use the Client Access ODBC-Driver and test it with Microsoft Query (office)
Is your OS or MSSQL 64-bit ?, you need to use the same xx-bit version of ODBC-Manager, otherwise your linked server couldn't be able to connect with AS400.
Don't forget to check your rights CALL & SELECT if it possible.
If you have a lot of data, deactivate the connection limit.

Ready?

@next step: "linked server"

NOTE: Please post screenshots of your dsn configuration...!!!
0
 
JArndt42Author Commented:
I have the connection already. I currently use pass through with MS Access. I have another question open on EE that is related to that. I have been reading about linked server. When I attempt to create the linked server I have to fill out the following fields. I need to know what goes into the linked Server field.

Linked Server: ???
Other Data Source: Microsoft OLE DB Provider for ODBC Drivers
Product Name: Whatever I want to name it?
Data Source: AS400 ODBC ( then name of my driver I made on my machine)
Provider String: Provider=MSDASQL.1;Password=xxxxxx;Persist Security Info=True;User ID=xxxxx;Data Source=AS400 ODBC;Initial Catalog=IESFILE

How do I check to see if both are 64 bit?
0
 
Jim P.Commented:
To see whether a Windows system is 64 bit you would right click on My Computer then select Properties. It will say it under System.
0
 
JArndt42Author Commented:
it says Microsoft Windows XP
Professional
Version 2002
service Pack 3
0
 
Jim P.Commented:
That is on your workstation. Or is that where your SQL Server is located as well?
0
 
BAKADYCommented:
Just this:

Product Name: Whatever You want to name it?
Data Source: AS400 ODBC ( then name of your Dsn)

After that you will find into the advance connections properties of your linked server a Place to setup the As400 User and password.

I dont know how its calls into SQL 2k, but i think you will be able to Input your as400 User and the password.

To Check your Connection create a New query and write:

Select * from openquery( yourlinkedserversmane , 'select count(*) from someas400library.someas400table')
Go

Ready???


@next step: create Stored procedures to Sync, copy or write Data from as400 to SQL and Reverse.
0
 
JArndt42Author Commented:
that is my workstation. the machine that SQL Server is a 64 bit.
0
 
BAKADYCommented:
Have you 2 odbc Manager versions???
0
 
JArndt42Author Commented:
BAKADY, it is making me fill out the Linked Server field and I can not continue until it is filled out. What should I put in there?
0
 
JArndt42Author Commented:
This is a screen shot of my DSN
DSN.bmp
0
 
JArndt42Author Commented:
here is a copy of the set up screen for the linked server.
Linked-Server-Set-up.bmp
0
 
JArndt42Author Commented:
I get the following error when I try attempt to open a table on this newly created Linked server I just made.:
Error 7399: OLE DB providor 'MSDASQL' Reported an error.
Data source name not found and no default driver specified]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBinitialize:: Initialize returned 0x80004005:]
0
 
BAKADYCommented:
Dont use blanks/spaces into names!!!!!

And delete the provider string, if it's require write DSN=YourDSNname
0
 
JArndt42Author Commented:
thank you for your help. same error even when I created a new DSN without spaces and removed the string and when wrote DSN = my dsname. There is something wrong and driving me crazy. I have a feeling it has something to do with that Linked server:
0
 
BAKADYCommented:
Have you create a User DSN or System DSN?
You Need a System DSN!
Orherwise mssql wouldnt find it!
0
 
JArndt42Author Commented:
OK I tried that too. same issue. hmmmmmmmm
0
 
BAKADYCommented:
i need a new screenshot of you linked server current options, security and provider options too...
which rights have your as400 user...???

Reference:  http://support.microsoft.com/kb/2450479

make some others screenshots too... any tab of the DSN, it can help to perform your connection... any option of your linked server, maybe your right the user/password at the wrong place...  your user configuration WRKUSR(yourusername), maybe your dont have the richts for....   and you openquery sql request that fails...

NOTE to the EE Moderator: I hope i get 100.000 point if i get it working!!!!   ;)
0
 
BAKADYCommented:
JArndt42: ask to the EE moderator, if there's here some kind of visual assistance posible... i allready get a warning because i tried to contact you offside EE.  sorry, ... so are rules... you need appropriate assistance to do this...

it's aroung 2 days since your question is online and it isn't working...

i want to help but i drive blind... sorry.
0
 
BAKADYCommented:
like i said, with this requirements i am able to Connect AS400 and MSSQL:

- IBM iSeries Server with opened ports to connect to it with Client Accees 32-bit ODBC Driver
- An enabled AS400 user for login
- Windows Server 2003/2008 64-bit with followed installed software:
- MS SQL Server 2005/2008 R2 (no express editions)
- Client Access 32-Bit ODBC-Driver

i can make a tutorial too,  i don't really try to do one before... but i think the moderator can help us...   ;)

about sql  2k ... just i cann't put away the curiosity of because it isn't working.... just few parameters should be false...

regards
0
 
JArndt42Author Commented:
question. Does the DSN have to be on the machine that SQL Server is on?
0
 
JArndt42Author Commented:
Well for whatever reason this is not working. And I really do not have the time to deal with this. I will have to use a pass through, that does work, in access to the SQL Server and the pass through to the AS400 as well. I was just trying to get it to work with SQL Server so that everything could be done on the back side.
0
 
JArndt42Author Commented:
I have been using Enterprise Manager at my work station. I do not have access to the Server at this time. I will work on that. Thank you so very much for your help. I sure hope I can get this to work.
0
 
JArndt42Author Commented:
I am sure it will work When I get access directly to my Server. Thank you for all your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.