connecting to as400

  • Hello All, I have this problem:

    I can connect to a AS400 database with an ODBC driver and

    query a table, this is ok.

    Now I want to query a table in AS400 with data from a single dbf table

    in my pc or with a table in Access Database.

    I have tried to use OPENROWSET with no results..

    Regards

    Erick j. Matus

  • Could you post your code and error messages?

    Normally, you need to use full name while querying data in a remote site.

  • Yes, you are right, this is the code:

    Dim DB2Connection As New OdbcConnection()

    Dim DB2DataReader As OdbcDataReader

    StrConn = "Dsn=AS400;system=CLIENT53;cmt=0;dbq=" & AS400Lib & ";nam=0;dft=5;dsp=1;tft=0;tsp=0;dec=0;xdynamic=1;recblock=2;blocksize=256;scrollable=0;translate=0;lazyclose=1;libview=0;remarks=0;conntype=0;sorttype=0;languageid=ENU;sortweight=0;prefetch=0;dftpkglib=QGPL;mgdsn=0"

    DB2Connection.ConnectionString = StrConn

    Dim DB2Command As New OdbcCommand()

    SqlStr = "SELECT FAC200.fac3030.FNUFAC,facts.fnuFAC FROM

    FAC200.fac3030,

    OPENROWSET 'Microsoft.Jet.OLEDB.4.0','C:\ENACAL.mdb';;,FACTS)

    AS FACTs WHERE fac3030.FNUFAC = FACTS.FNUFAC"

    DB2Command.CommandText = SqlStr

    DB2Command.Connection = DB2Connection

    DB2Connection.Open()

    DB2DataReader = DB2Command.ExecuteReader()

    The message i get is: The Column or Table FACTS is not defined.

    Regards

    Erick

  • Here is a link, which may help you build your link.

    http://msdn2.microsoft.com/en-us/library/ms190312.aspx

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply