HOME

FORUM

UPLOAD SOURCE

RPGLE/RPG

CLLE

SQLRPGLE

DDS

API

OTHER

JAVA

IFS

HTML

JAVA SCRIPT

PHP

MYSQL

XML

OLE DB




    OLE DB  - OLE DB Provider for AS/400 (from IBM)
Posted By: JimmyOctane   Contact

Conn.Open "Provider=IBMDA400;" & _
"Data source=myAS400;" & _
"User Id=myUsername;" & _
"Password=myPassword"



    OLE DB  - OLE DB Provider for AS/400 and VSAM (from Microsoft)
Posted By: JimmyOctane   Contact

Conn.Open "Provider=SNAOLEDB;" & _
"Data source=myAS400;" & _
"User Id=myUsername;" & _
"Password=myPassword"


The Microsoft® OLE DB Provider for AS/400 and VSAM also supports a number of
provider-specific arguments,

some of which have default values as specified in the table below.
hese arguments are as follows:

Argument Description
BinAsChar This parameter indicates whether to process binary fields
as character fields default is 0, don't process binary fields as
character fields.

CCSID The Code Character Set Identifier (CCSID) attribute indicates
the character set used on the host. If this argument is omitted, the
default value is U.S./Canada (37).

Default Library The default AS/400 library to be accessed.
This parameter is not required for mainframe access and is optional
when connecting to AS/400 files.

HCDFileName The fully qualified filename of the DDM host column
description (HCD) file. This parameter can be an UNC string up
to 256 characters in length. A path does not need to be included
in the name if the HCD file is located in the SNA system directory.
This parameter is required when connecting to mainframe systems
and is optional when connecting to OS/400.

LocalLU The name of the local LU alias configured in Host Integration
Server. ModeName The APPC mode (must be set to a value that matches
the host configuration and Host Integration Server configuration.
Legal values for the APPC mode include
QPCSUPP (5250),
#NTER (interactive),
#NTERSC (interactive),
#BATCH (batch),
#BATCHSC (batch),
and custom modes.


NetAddr When TCP/IP has been selected for the Network Transport Library,
this parameter indicates the IP address of the host.

NetPort When TCP/IP has been selected for the Network Transport Library,
this parameter is the TCP/IP port used for communication with the source.
The default value is TCP/IP port 446.

NetLib This parameter determines whether TCP/IP or SNA APPC is used
for network communication. The possible values for this parameter are
TCPIP or SNA. This value defaults to SNA.

PCCodePage The character code page to use on the PC.
If this argument is omitted, the default value is set to Latin 1 (1252).

RDB The Remote DataBase name for OS/400. You only need to specify
this value if it is different from the remote LU alias configured
in Host Integration Server.

Repair Host Keys This parameter indicates whether the OLE DB
provider should repair any host key values set in the registry and defaults to false.

RemoteLU The name of the remote LU alias configured in Host
Integration Server.

StrictVal This parameter indicates whether strict validation
should be used and defaults to false.

Note
Not all of these parameters are required. The user can also be prompted
for this information. A sample ConnectionString for use with the OLE DB
Provider for AS/400 and VSAM follows:

Conn.Provider="SNAOLEDB"
Conn.ConnectionString = "User ID=USERNAME;Password=password",&_
"LocalLU=LOCAL;RemoteLU=DATABASE",&_
"ModeName=QPCSUPP;CCSID=37;PCCodePage=437"
Conn.Properties("PROMPT")=adPromptNever
Conn.Open

The &_ character combination is used for continuing long lines in Visual Basic.
When opening a connection object in ADO 2.0, you must specify the Prompt connection
property. For example, the following is valid with ADO 1.5 and ADO 2.0 and will
prompt the user for ConnectionString properties:

Conn.ConnectionString = "Provider=SNAOLEDB
Conn.Properties("PROMPT")=adPromptAlways
Conn.Open

    OLE DB  - using ADO and OLE DB from within an Active Server Page
Posted By: JimmyOctane   Contact
<HTML>

<HEAD>

<CENTER><H1>Data Set Results</H1>

</HEAD>

<BODY>

<%

Set conn = Server.CreateObject("ADODB.Connection")

conn.open "Provider=IBMDA400;Data Source=SYSNAME;User
ID=USER;Password=SECRET;"

sql = "SELECT EMPNAM, EMPAD1, EMPAD2, EMPSTE, EMPZIP FROM QGPL.EMPMAST"

Set rs = Server.CreateObject("ADODB.Recordset")

set rs.ActiveConnection=conn

rs.Open sql

if conn.errors.count=0 Then

Response.write "<table border='1' cellspacing='1' cellpadding='1'
width='80%'><thead><caption><FONT SIZE=-1 FACE='arial, helvetica'><b>Query
for File " & request.Form("LibFile") & "</caption><tr>"

rs.MoveFirst

if Not rs.EOF Then

for x=0 to rs.fields.count-1

Response.write "<th BGCOLOR='#0066cc' WIDTH=60><FONT SIZE=-1
FACE='arial, helvetica'><b><font color='#ffffff'>" & rs.fields(x).name &
"</th>"

next

End If



do until rs1.eof

Response.write "<tr>"

For I=0 To rs1.Fields.Count-1

Response.write "<td><FONT SIZE=-1 FACE='arial, helvetica'>" &
Trim(rs1.Fields(I).Value) & "</td>"

Next

Response.write "</tr>"

rs.MoveNext

loop

rs.close

conn.close



Response.write "</TBODY></TABLE>"

%>

</BODY>

</HTML>

About Code400.com | resume | Search | Site Map | Suggestions
© Copyright 2003-2008 Code400.com



Monday Sep 06, 2010 @ 5:33 PM