Hi there Lina,
Here are my experiences and tips from the field....
1) On your SQL server create a System DSN for the AS400 you are trying
to connect to. It MUST be a System DSN, I couldn't work out why, and
quite frankly I don't care, just accept it, its the way the world is.
The DSN for this example will be called "MYAS"
2) When you set up your System DSN I changed the following:-
Under TAB Server, I changed the Default Libraries to the name of the
library I was working on.
Under TAB Package(s) I changed the Default Package Library to the one
I was working on.
Under TAB Other, set Scrollable Cursor to Allways scrollable.
3) On your SQL server, create a linked server. Use the Microsoft OLE
DB for ODBC Provider. Under Provider Options, set the following to
True:-
Allow InProcess
Non transacted Updates
Linked Server Name is "MYAS" (this is what you will refer to it as in
code)
Product Name is "MYAS" (from Above)
Data Source is "MYAS" (from Above)
Under Server Options set the RPC and RPC Out ticks to ON
5) Set your security to how you want it.
That is it for the Setup
From ISQLW query analyzer:-
select * from
OPENQUERY(MYAS, 'Select * from library.file')
insert into
OPENQUERY (MYAS, 'Select * from library.file')
select '1', '2', 3, 'Test123', 1, '', '', 23
delete from
OPENQUERY(MYAS, 'SELECT * FROM LIBRARY.FILE')
where REQ = 23
Tips for above... If you want to Insert/Update/Delete you MUST turn on
Journalling. There is an option in the ODBC driver setup COMMIT =
*NONE which is meant to override this, but it doesn't work.
The delete statement is case sensative, and the insert/select is not -
go figure!!! So you will note above that I have used uppercase in the
delete statement.
I hope this helps you out, I didn't run an update, and god willing I
won't have to. This has been THE MOST PAINFUL experience in my life,
and with any luck I will not have anything to do with it again from
this point on.
[quoted text, click to view] "Lina" <anonymous@discussions.microsoft.com> wrote in message news:<1503701c415ac$25dfd200$a301280a@phx.gbl>...
> Hello,
> Can anyone tell me where I can find info on how to do
> this?
>