# Daten aus einer html mit access auslesen und in einer tabelle wiedergeben



## bloodbearer (18. Januar 2012)

Hallo 

Ich habe folgendes Problem:

Ich möchte Daten aus einer HTML auslesen und in Access ausgeben. Problem bei der HTML ist, ich muss auf den Inhalt zugreifen, was ich mit einem String definiere. Aber so ganz funktioniert das noch nicht.
Ich wäre euch sehr dankbar, wenn mir jmd den entscheiden Lösungsvorschlag bringt.

Dazu der Code:

```
Function getAWB2()

'On Error GoTo ErrHdl

Dim strAWB As String
Dim strURL As String
Dim IEApp As Object, IEDoc As Object

If Not IsNull(DLookup("[ID]", "MSysObjects", "[Name]='tblAWBInfo'")) Then
   DoCmd.DeleteObject acTable, "tblAWBInfo"
End If

Set tdf = CurrentDb.CreateTableDef
tdf.Name = "tblAWBInfo"
Set fld = tdf.CreateField("strAWB", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("strInfos", dbMemo)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Checkpoint", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Station", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Location", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Date/Time", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Pcs", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Route", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Cycle", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Stat", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("PgIn", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Count", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Last", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Remarks", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Comments", dbText, 255)
tdf.Fields.Append fld
CurrentDb.TableDefs.Append tdf
CurrentDb.TableDefs.Refresh

Set rs = CurrentDb.OpenRecordset("tblAWBInfo", dbOpenDynaset)

'strAWB = InputBox("AWB")
   
Set IEApp = CreateObject("InternetExplorer.Application")
IEApp.Visible = True

Set rsbold = CurrentDb.OpenRecordset("tblAWB", dbOpenSnapshot)
rsbold.MoveFirst


Do Until rsbold.EOF
     strURL = "http://npts2.apis.dhl.com:6010/npts/ShipmentDataFetchServlet?action=14&querycriteria=QUERY_BY_AWB&queryData=" & Trim(rsbold!AWB)
     IEApp.Navigate strURL
    Do
        If UseDoEvents = True Then DoEvents
        Loop Until IEApp.Busy = False Or bBreak = True
    Set IEDoc = IEApp.Document
    Do: Loop Until IEDoc.ReadyState = "complete"

'    On Error GoTo ErrHdl1

    i = 20
    ValNoCP = Trim(Mid(Trim(IEDoc.all.tags("tr").Item(18).innerText), InStr(IEDoc.all.tags("tr").Item(18).innerText, "No of Distinct Checkpoints:") + 27, 3))
   
'MsgBox(valNoCP)

        Do Until i > ValNoCP + 19
'MsgBox (i)
            strInfos = Trim(IEApp.Document.all.tags("tr").Item(i).innerHTML)
            If strInfos = "" Then
                strInfos = " "
            End If
            rs.AddNew
            rs!strAWB = Trim(rsbold!AWB)
            rs!strInfos = strInfos
            rs.Update
            i = i + 1
        Loop
rsbold.MoveNext
'ErrHdl1: rsbold.MoveNext

Loop

If IEApp.Visible = True Then
    IEApp.Quit
End If

Exit Function
ErrHdl:

MsgBox (Err.Number & ": " & Err.Description)
End Function

Function selectInfo()

Set db = CurrentDb
Set rs = db.OpenRecordset("tblAWBInfo", dbOpenDynaset)
'db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,' class=grayTdNormal', '')"
'db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,' class=whiteTdNormal', '')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'&nbsp;', '')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'</A>', '')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'</TD>', '')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'< TD>', '')"

 


rs.MoveFirst


'strng = Mid(strng, _
'           InStr(strng, "</2>") + 20, _
'           InStr( _
'              InStr(strng, "</2>") + 20, _
'              strng, _
'              "</2>") _
'            - InStr(strng, "</2>") + 20)
'Set rs2 = duba

Do Until rs.EOF
       Do While InStr(rs!strInfos, "<") > 0
        Strng = rs!strInfos
        leftstr = Mid(Strng, InStr(Strng, "<"), 3)
        Strng = Replace(Strng, _
                    Mid(Strng, _
                    InStr(Strng, "<"), _
                    InStr(Strng, ">") - InStr(Strng, "<") + 1), _
                IIf(leftstr = "<A ", "", IIf(leftstr = "<TD", "[B/]", "KAT")), _
                1, 1)
        rs.Edit
        rs!strInfos = Strng
        rs.Update
       Loop
    rs.MoveNext
Loop

db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,chr(10), '')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'&gt;','>')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'&lt;','<')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'&amp;','&')"

rs.MoveFirst
Do Until rs.EOF
    i = 0 '0
    Do Until i > 12 '11
        strig = rs!strInfos
        strig = Mid(strig, InStr(strig, "[B/]") + 4, InStr(strig, "[ /E]") - InStr(strig, "[B/]") - 4)
        strig = Trim(strig)
        If strig = "" Then
           strig = " "
        End If
        rs.Edit
        rs(i + 2) = strig
        rs.Update

        strug = rs!strInfos
        strug = Replace(strug, Left(strug, InStr(strug, "[ /E]") + 4), "", 1, 1)
        If strug = "" Then
           strug = rs!strInfos
        End If
        rs.Edit
        rs!strInfos = strug
        rs.Update
        i = i + 1
    Loop
    rs.MoveNext
Loop

rs.Close
db.Close

End Function
```

Sitze da nun schon seit wochen dran, um das Problem zu beheben. Bitte helft mir.

Danke


----------



## Yaslaw (18. Januar 2012)

Hallo erst mal.

*item: *Kannst du bitte dein Code formatiert in VB-Tags setzen? Dann wird er lesbar
[code=vb]Dein code[/code]

*item: *Deine Aussage 'Aber so ganz funktioniert das noch nicht.' ist nicht wirklich hilfreich in sovielen Code-Zeilen ein Problem zu finden. Also, was geht nicht?

*item: *ggf währee s auch schön, einen Beispiel-HTML-String zu haben und ein passendes Tabellenbeispiel. Also 'Das hab ich' und 'Das will ich'


----------



## bloodbearer (20. Januar 2012)

Das mein code:

```
Function getAWB2()
 
'On Error GoTo ErrHdl
 
Dim strAWB As String
Dim strURL As String
Dim IEApp As Object, IEDoc As Object
 
If Not IsNull(DLookup("[ID]", "MSysObjects", "[Name]='tblAWBInfo'")) Then
   DoCmd.DeleteObject acTable, "tblAWBInfo"
End If
 
Set tdf = CurrentDb.CreateTableDef
tdf.Name = "tblAWBInfo"
Set fld = tdf.CreateField("strAWB", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("strInfos", dbMemo)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Checkpoint", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Station", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Location", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Date/Time", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Pcs", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Route", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Cycle", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Stat", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("PgIn", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Count", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Last", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Remarks", dbText, 255)
tdf.Fields.Append fld
Set fld = tdf.CreateField("Comments", dbText, 255)
tdf.Fields.Append fld
CurrentDb.TableDefs.Append tdf
CurrentDb.TableDefs.Refresh
 
Set rs = CurrentDb.OpenRecordset("tblAWBInfo", dbOpenDynaset)
 
'strAWB = InputBox("AWB")
   
Set IEApp = CreateObject("InternetExplorer.Application")
IEApp.Visible = True
 
Set rsbold = CurrentDb.OpenRecordset("tblAWB", dbOpenSnapshot)
rsbold.MoveFirst
 
 
Do Until rsbold.EOF
     strURL = "http://npts2.apis.dhl.com:6010/npts/ShipmentDataFetchServlet?action=14&querycriteria=QUERY_BY_AWB&queryData=" & Trim(rsbold!AWB)
     IEApp.Navigate strURL
    Do
        If UseDoEvents = True Then DoEvents
        Loop Until IEApp.Busy = False Or bBreak = True
    Set IEDoc = IEApp.Document
    Do: Loop Until IEDoc.ReadyState = "complete"
 
'    On Error GoTo ErrHdl1
 
    i = 20
    ValNoCP = Trim(Mid(Trim(IEDoc.all.tags("tr").Item(18).innerText), InStr(IEDoc.all.tags("tr").Item(18).innerText, "No of Distinct Checkpoints:") + 27, 3))
   
'MsgBox(valNoCP)
 
        Do Until i > ValNoCP + 19
'MsgBox (i)
            strInfos = Trim(IEApp.Document.all.tags("tr").Item(i).innerHTML)
            If strInfos = "" Then
                strInfos = " "
            End If
            rs.AddNew
            rs!strAWB = Trim(rsbold!AWB)
            rs!strInfos = strInfos
            rs.Update
            i = i + 1
        Loop
rsbold.MoveNext
'ErrHdl1: rsbold.MoveNext
 
Loop
 
If IEApp.Visible = True Then
    IEApp.Quit
End If
 
Exit Function
ErrHdl:
 
MsgBox (Err.Number & ": " & Err.Description)
End Function
 
Function selectInfo()
 
Set db = CurrentDb
Set rs = db.OpenRecordset("tblAWBInfo", dbOpenDynaset)
'db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,' class=grayTdNormal', '')"
'db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,' class=whiteTdNormal', '')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'&nbsp;', '')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'</A>', '')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'</TD>', '')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'< TD>', '')"
 
 
 
 
rs.MoveFirst
 
 
'strng = Mid(strng, _
'           InStr(strng, "</2>") + 20, _
'           InStr( _
'              InStr(strng, "</2>") + 20, _
'              strng, _
'              "</2>") _
'            - InStr(strng, "</2>") + 20)
'Set rs2 = duba
 
Do Until rs.EOF
       Do While InStr(rs!strInfos, "<") > 0
        Strng = rs!strInfos
        leftstr = Mid(Strng, InStr(Strng, "<"), 3)
        Strng = Replace(Strng, _
                    Mid(Strng, _
                    InStr(Strng, "<"), _
                    InStr(Strng, ">") - InStr(Strng, "<") + 1), _
                IIf(leftstr = "<A ", "", IIf(leftstr = "<TD", "[B/]", "KAT")), _
                1, 1)
        rs.Edit
        rs!strInfos = Strng
        rs.Update
       Loop
    rs.MoveNext
Loop
 
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,chr(10), '')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'&gt;','>')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'&lt;','<')"
db.Execute "UPDATE tblAWBInfo SET tblAWBInfo.strInfos = Replace(tblAWBInfo.strInfos,'&amp;','&')"
 
rs.MoveFirst
Do Until rs.EOF
    i = 0 '0
    Do Until i > 12 '11
        strig = rs!strInfos
        strig = Mid(strig, InStr(strig, "[B/]") + 4, InStr(strig, "[ /E]") - InStr(strig, "[B/]") - 4)
        strig = Trim(strig)
        If strig = "" Then
           strig = " "
        End If
        rs.Edit
        rs(i + 2) = strig
        rs.Update
 
        strug = rs!strInfos
        strug = Replace(strug, Left(strug, InStr(strug, "[ /E]") + 4), "", 1, 1)
        If strug = "" Then
           strug = rs!strInfos
        End If
        rs.Edit
        rs!strInfos = strug
        rs.Update
        i = i + 1
    Loop
    rs.MoveNext
Loop
 
rs.Close
db.Close
 
End Function
```

Das ist der HTML String:

```
<html>
<head>
<title> WebFSQ - ShipmentDetails </title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link  rel="Stylesheet"  type="text/css" href = "/npts/js/common/style.css">
<script language="JavaScript1.3" src="/npts/js/webfsq/WebFSQImages.js"></script>
<script language="JavaScript1.3" src="/npts/js/common/common.js"></script>

<script language="JavaScript1.3">
<!--

//Start Change: rahul_shah: WO CS0143: WFSQ2.1.0: 07-01-2003

//For opening a new window object.
var controlObject = new Object( );
var viewImageWindow = null;
var chkPtInfoWindow = null;
var dupChkPtInfoWindow = null;
var shipperReferenceWindow = null;
var titleMessage = "";
var nptsHelpPageId ="";

//End Change: rahul_shah: WO CS0143: WFSQ2.1.0: 07-01-2003

/*
  * DESCRIPTION   : This function is called to display additional Checkpoint Informations.
  * parameter    : value.
*/
function checkPointClicked ( value )
{
    titleMessage = "Checkpoint Details From Shipment Detail"  ;
    nptsHelpPageId = "WF05";
    jspURL = '/npts/jsp/webfsq/CheckPointInfo.jsp?id=' + value
    var popupUrl = "/npts/jsp/common/NPTSPopup.jsp";
    popupUrl =  popupUrl + "?" + "POPUP_SRC_URL" + "=";
    popupUrl =  popupUrl + escape( jspURL );


    var w = 500;
    var h = 400;

    var leftVal = getLeftPosition ( w );
    var topVal  = getTopPosition ( h );

    winAttributes = 'width=' + w + ',height=' + h + ',left=' + leftVal + ',top=' + topVal;

    winAttributes = winAttributes + ',scrollbars=no,titlebar=no'
    winAttributes = winAttributes + ',resizable=yes, status=yes'



 //   winAttributes = 'width=500,height=400,scrollbars=no,screenX=0,screenY=0,resizable=yes,status=yes'
    chkPtInfoWindow = window.open( popupUrl ,'chkPtInfo', winAttributes );
    chkPtInfoWindow.focus( );



}



/*
  * DESCRIPTION   : This function is called to display Piece Details.
  * parameter    : value.
*/
function pieceClicked( awb )

{
    titleMessage = "Piece Details From Shipment Detail" ;
    nptsHelpPageId = "WF07";
    url = '/npts/ShipmentDataFetchServlet?';
    url += 'action=';
    url += '17';
    url += '&ALL_PIECE_INFO_AWB=';
    url += awb;
    var popupUrl = "/npts/jsp/common/NPTSPopup.jsp";
    popupUrl =  popupUrl + "?" + "POPUP_SRC_URL" + "=";
    popupUrl =  popupUrl + escape( url );

    var w = 600;
    var h = 500;

    var leftVal = getLeftPosition ( w );
    var topVal  = getTopPosition ( h );

    winAttributes = 'width=' + w + ',height=' + h + ',left=' + leftVal + ',top=' + topVal;

    winAttributes = winAttributes + ',scrollbars=no,titlebar=no'
    winAttributes = winAttributes + ',resizable=yes, status=yes'

//    winAttributes = 'width=600,height=500,scrollbars=no,screenX=0,screenY=0,resizable=yes,status=yes'
    pieceDetailWindow = window.open( popupUrl ,'pieceDetail', winAttributes );
    pieceDetailWindow.focus( );
}


/*
  * DESCRIPTION   : This function is called to display Duplicated Checkpoint Informations..
  * parameter    : value.
*/
function dupChkPtClicked ( value )
{
    if( value != "" )
    {
        titleMessage = "Duplicate Checkpoint Details From Shipment Detail" ;
        nptsHelpPageId = "WF06";
        jspURL = '/npts/jsp/webfsq/DupChkPtInfo.jsp?id=' + value
        var popupUrl = "/npts/jsp/common/NPTSPopup.jsp";
        popupUrl =  popupUrl + "?" + "POPUP_SRC_URL" + "=";
        popupUrl =  popupUrl + escape( jspURL );

        var w = 800;
        var h = 500;

        var leftVal = getLeftPosition ( w );
        var topVal  = getTopPosition ( h );

        winAttributes = 'width=' + w + ',height=' + h + ',left=' + leftVal + ',top=' + topVal;

        winAttributes = winAttributes + ',scrollbars=no,titlebar=no'
        winAttributes = winAttributes + ',resizable=yes, status=yes'


//      winAttributes = 'width=800,height=500,scrollbars=no,screenX=0,screenY=0,resizable=yes,status=yes'
        dupChkPtInfoWindow = window.open( popupUrl ,'dupChkPtInfo', winAttributes );
        dupChkPtInfoWindow.focus( );
    }
}
// This function loads the title in the top frame.
function loadTitle()
{
	if( window.name == "mainFrame" )
	{
		updatePageTitle( "Shipment Details", "WF03" );
	}
}


/*
  * DESCRIPTION   : This function is called to trap key ctrl+shift+key events for
                    IE/Nav4 browser.
  * parameter    : key id.
*/
function func_trap_key( keyid )
{
    switch ( keyid )
    {
         case 3: buttonClicked('cycle');// Ctrl-Shift-c
                  break;
         case 8:  buttonClicked('help'); // Ctrl-Shift-h
                  break;
         case 16: buttonClicked('back');// Ctrl-Shift-p
                  break;         
         case 18: buttonClicked('reverse');// Ctrl-Shift-r
                  break;
         case 17: buttonClicked('ttQuery');// Ctrl-Shift-q
                  break;
         case 20: buttonClicked('trace');// Ctrl-Shift-t
                  break;
         
    }
}

//-->
</script>
</head>








<script>

//Start Change: rahul_shah: WO CS0143: WFSQ2.1.0: 07-01-2003

//For opening a new window properties.
winHeight = '400';
winWidth = '600';
wintop = ( window.screen.height -  winHeight ) / 2;
windLeft = ( window.screen.width - winWidth ) / 2;
winAttributes = 'left='+ windLeft +', top='+ wintop;
winAttributes += ',width='+ winWidth +',height='+winHeight;
winAttributes += 'titlebar=no, resizable=yes, menubar=yes, status=yes, scrollbars=yes';

/*
  * DESCRIPTION   : This function is called when 'ok' or 'clear' button is clicked.
  * parameter    : option ie 'ok' or 'clear'.
*/
function buttonClicked( option )
{
    var targetServlet = '/npts/ShipmentDataFetchServlet?';
	airWayBillNum = "1024953720";

    switch ( option )
    {
        case 'reverse' :
        {
            url = targetServlet;
            url += 'action=';
            url += '2';
            self.document.shipmentDetailsForm.action = url;
            self.document.shipmentDetailsForm.submit();
            break;
        }
        case 'cycle' :
        {
            url = targetServlet;
            url += 'action=';
            url += '3';
            self.document.shipmentDetailsForm.action = url;
            self.document.shipmentDetailsForm.submit();
            break;
        }
        case 'trace' :
        {
            if( airWayBillNum.length <= 10 )
            {
	            url = targetServlet;
	            url += 'action=';
	            url += '5';
	            self.document.shipmentDetailsForm.action = url;
	            self.document.shipmentDetailsForm.submit();
            }
            else
            {
	            controlObject = self.document.shipmentDetailsForm;
                showAlertPopUp("Trace request is available only for White DHL Shipments!");
            }
            break;
        }
        case 'ttQuery' :
        {
            

		            if( airWayBillNum.length <= 10 )
		            {
		                url = targetServlet;
		                url += 'action=';
		                url += '4';
		                self.document.shipmentDetailsForm.action = url;
		                self.document.shipmentDetailsForm.submit();
		            }
		            else
		            {
			            controlObject = self.document.shipmentDetailsForm;
		                showAlertPopUp("TTQuery is available only for White DHL Shipments!");
		            }
                    break;
             

        }
        case 'shipperReference' :
        {
            titleMessage = "Shipper Reference Details From Shipment Detail";
            nptsHelpPageId = "WF04";
            jspURL = '/npts/jsp/webfsq/ShipperReference.jsp'
            var popupUrl = "/npts/jsp/common/NPTSPopup.jsp";
            popupUrl =  popupUrl + "?" + "POPUP_SRC_URL" + "=";
            popupUrl =  popupUrl + escape( jspURL );


	        var w = 600;
	        var h = 500;

	        var leftVal = getLeftPosition ( w );
	        var topVal  = getTopPosition ( h );

	        winAttributes = 'width=' + w + ',height=' + h + ',left=' + leftVal + ',top=' + topVal;

	        winAttributes = winAttributes + ',scrollbars=no,titlebar=no'
	        winAttributes = winAttributes + ',resizable=yes, status=yes'


//          winAttributes = 'width=600,height=500,scrollbars=no,screenX=0,screenY=0,resizable=yes,status=yes'
            shipperReferenceWindow = window.open( popupUrl ,'shipperReference', winAttributes );
            shipperReferenceWindow.focus( );

            break;
        }
        case 'help' :
        {
            onHelp( self.document.shipmentDetailsForm.helpPageId.value );
            break;
        }
        case 'back' :
        {
        	 url = "/npts/HAWBQueryServlet?action=2222&key=";
             url += "";
             self.document.shipmentDetailsForm.action = url;
             self.document.shipmentDetailsForm.submit();
             break;
        }
    }
}

/*
  * DESCRIPTION   : This function is called to view Airwaybill Images from CIA.
*/
function viewAirWayBill()
{
    /*
    imageURL = "";
    airWayBillNum = "1024953720";
    viewAwbApi = "doc_type1=AWB&response=L&doc_id=";
    url= imageURL+viewAwbApi+airWayBillNum;

    //To check CIA server is up or not. If not then set url of error page.
    if ( "" == "" )
    {
        url = '/npts/jsp/webfsq/ViewErrorMsg.jsp';
    }

    viewImageWindow = window.open( url, 'ViewImg', winAttributes );
    viewImageWindow.focus();
    */
}

/*
  * DESCRIPTION   : This function is called to view Invoice Images from CIA.
*/
function viewInvoice()
{
    /*
    imageURL = "";
    airWayBillNum = "1024953720";
    viewAwbApi = "doc_type1=INV&response=L&doc_id=";
    url= imageURL+viewAwbApi+airWayBillNum;

    //To check CIA server is up or not. If not then set url of error page.
    if ( "" == "" )
    {
        url = '/npts/jsp/webfsq/ViewErrorMsg.jsp';
    }

    viewImageWindow = window.open( url, 'ViewImg', winAttributes );
    viewImageWindow.focus();
    */
}

/*
  * DESCRIPTION   : This function is called to view Proof Of Delivery image
  *                 from CIA.
*/
function viewProofOfDelivery()
{
    /*
    imageURL = "";
    viewAwbApi = "doc_type1=POD&response=L&business_rule=P&doc_id=";
    mulPodVal = "No";
    url= imageURL+viewAwbApi+mulPodVal;

    //To check CIA server is up or not. If not then set url of error page.
    if ( "" == "" )
    {
        url = '/npts/jsp/webfsq/ViewErrorMsg.jsp';
    }

    viewImageWindow = window.open( url, 'ViewImg', winAttributes );
    viewImageWindow.focus();
    */
}


/*
* This method goes to the servlet to validate the url and check the
* server status. If server is running and image is available then it
* displays the image in the pop up window.
*
* parameter : imageUrl      Imager Url AWB/Piece/POD
*
*/
function showImage( type, podValue )
{
    url = "";
    url += '/npts/ShipmentDataFetchServlet?';

    var w = 500;
    var h = 400;

    var leftVal = getLeftPosition ( w );
    var topVal  = getTopPosition ( h );

    winAttributes = 'width=' + w + ',height=' + h + ',left=' + leftVal + ',top=' + topVal;

    winAttributes = winAttributes + ',scrollbars=yes,titlebar=no'
    winAttributes = winAttributes + ',resizable=yes, menubar=0'



    //create url on the basis of the link clicked
    // call the servlet here ********
    switch ( type )
    {
        case 'AWB':
            url += 'action=';
            url += '11';
            break;
        case 'INV':
            url += 'action=';
            url += '12';
            break;
        case 'POD':
            url += 'action=';
            url += '13';
            url += '&MULTIPLE_POD=';
            url += 'No';
            break;
        case 'ALLPOD':
            url += 'action=';
            url += '13';
            url += '&MULTIPLE_POD=';
            url += podValue;
            break;
        default:
            break;
    }
/*    url +="&AWBNumber=";
      url +="1024953720";*/
    viewImageWindow = window.open( url ,'imageWin', winAttributes );
    viewImageWindow.focus( );
}

/*
  * DESCRIPTION   : This function is called to view Proof Of Delivery image
  *                 from CIA on click of 'pgln' link.
*/
function viewPODFromPgln( url )
{
    /*
    //To check CIA server is up or not. If not then set url of error page.
    if ( "" == "" )
    {
        url = '/npts/jsp/webfsq/ViewErrorMsg.jsp';
    }

    viewImageWindow = window.open( url, 'ViewImg', winAttributes );
    viewImageWindow.focus();
    */
}

/*
  * DESCRIPTION   : This function is called to view Signature image from CIA
  *                 on click of 'pgln' link.
*/
function viewSigFromPgln( value )
{
    /*
    jspURL = '/npts/jsp/webfsq/ViewSigImage.jsp?id=' + value

    //To check CIA server is up or not. If not then set url of error page.
    if ( "" == "" )
    {
        jspURL = '/npts/jsp/webfsq/ViewErrorMsg.jsp';
    }

    viewImageWindow = window.open( jspURL, 'ViewImg', winAttributes );
    viewImageWindow.focus();
    */
}

//  Start Change Add    Bhaveshs    27-Jun-2003 for change request

/*
  * DESCRIPTION   : To view all the POD images of checkpoint for
  *                 corrosponding route & cycle.
*/
function viewAllPODImages( value )
{
    /*
    //To check CIA server is
    imageURL = "";
    viewAwbApi = "doc_type1=POD&response=L&business_rule=P&doc_id=";
    url= imageURL+viewAwbApi+value;

    //To check CIA server is up or not. If not then set url of error page.
    if ( "" == "" )
    {
        url = '/npts/jsp/webfsq/ViewErrorMsg.jsp';
    }

    viewImageWindow = window.open( url, 'ViewImg', winAttributes );
    viewImageWindow.focus();
    */
}

/*
  * DESCRIPTION   : This function is called to view Signature image from CIA
  *                 on click of 'pgln' link.
*/
function viewPODImages( ckhptCount )
{
    targetServlet = '/npts/ShipmentDataFetchServlet?';
    url = targetServlet;
    url += 'action=';
    url += '10&';
    url += 'CHECK_POINT_COUTNT=';
    url += ckhptCount;

    viewImageWindow = window.open( url, 'ViewImg', winAttributes );
    viewImageWindow.focus();

}

//  End Change Add    Bhaveshs    27-Jun-2003 for change request

/*
* DESCRIPTION : This function closes all child windows onUnload
*               parent window.
*/
function closeChildWindow ( )
{
    closeMe( viewImageWindow );
    closeMe( chkPtInfoWindow );
    closeMe( dupChkPtInfoWindow );
    closeMe( shipperReferenceWindow );
}


//Closes the Pop window and makes the handle null
function closeMe( popUpHandle )
{
    if ( popUpHandle != null )
    {
        popUpHandle.close();
        popUpHandle = null;
    }
}

//End Change: rahul_shah: WO CS0143: WFSQ2.1.0: 07-01-2003

//-->
</script>

<body onLoad="javascript:loadTitle()" onUnload="closeChildWindow()">
<form name="shipmentDetailsForm" method="post" action="" >
<input type="hidden" name="helpPageId" value="WF03">
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
<tr>
     <td><img src="/npts/images/blank.gif" width="28"></img></td>
     <td>

        <table border="0" cellspacing="0" width="100%" >
        <tr valign="center">
            <td  class="blackHeadingLeft"> Shipment Details  </td>
        </tr>
        <tr>
        </tr>
        <tr>
            <td></td>
        </tr>
        </table>

        <table border="0" cellspacing="0" width="100%" >
        <tr>
            <td  class="whiteTd" height="21" >&nbsp;AWB:
            </td>
            <td class="whiteTdNormal" height="21" nowrap>&nbsp;
                1024953720
            </td>
            <td class="whiteTd" height="21" nowrap>&nbsp;No of Shipment Details:
            </td>
            <td class="whiteTdNormal" height="21" nowrap>&nbsp;
                1
            </td>
            <td class="whiteTdNormal" height="21" width="100%">&nbsp;</td>
        </tr>
        </table>
        <table border="0" cellspacing="1" width="100%" >
        <tr >
            <td class="grayTd" height="21" width= "5%" >&nbsp;Details</td>
            <td class="grayTd" height="21" width= "5%" align="center" >&nbsp;Orig</td>
            <td class="grayTd" height="21" width= "8%" align="center" >&nbsp;Location</td>
            <td class="grayTd" height="21" width= "7%" >&nbsp;Dest</td>
            <td class="grayTd" height="21" width= "5%" align="center" >&nbsp;Pcs</td>
            <td class="grayTd" height="21" width= "5%" >&nbsp;Weight(kg)</td>
            <td class="grayTd" height="21" width= "11%">&nbsp;Volumetric Weight(kg)</td>
            <td class="grayTd" height="21" width= "9%">&nbsp;Date/Time</td>
            <td class="grayTd" height="21" width= "8%" >&nbsp;Route/Cycle</td>
            <td class="grayTd" height="21" width= "8%" >&nbsp;Post Code</td>
            <td class="grayTd" height="21" width= "6%" >&nbsp;Product</td>
            <td class="grayTd" height="21" width= "9%" >&nbsp;Amount US$</td>
            <td class="grayTd" height="21" width= "9%" >&nbsp;Duplicate</td>
        </tr>

        <tr valign="TOP">
            
                <td class="whiteTdNormal" height="21" >1&nbsp;</td>
                <td class="whiteTdNormal" height="21" align="center" >&nbsp;</td>
                <td class="whiteTdNormal" height="21" align="center" >&nbsp;</td>
                <td class="whiteTdNormal" height="21" align="center" >&nbsp;</td>

            
                	<td class="whiteTdNormal" height="21" align="center" >&nbsp;0</td>
            
                <td class="whiteTdNormal" height="21" align="center" >&nbsp;0.0</td>
                <td class="whiteTdNormal" height="21" align="center" >&nbsp;0.0</td>
                <td class="whiteTdNormal" height="21" >&nbsp;</td>
                <td class="whiteTdNormal" height="21" align="center" >&nbsp;</td>
                <td class="whiteTdNormal" height="21" align="center" >&nbsp;</td>
                <td class="whiteTdNormal" height="21" align="center" >&nbsp;</td>
                <td class="whiteTdNormal" height="21" align="center" >&nbsp;0.0</td>
                <td class="whiteTdNormal" height="21" align="center" >&nbsp;No</td>
            
        </tr>
     </table>

     <table border="0" cellspacing="1" width="100%" >
        <tr >
            <td width="22%" height="21" class="grayTd">&nbsp;Shipper</td>
             
                <td width="15%" height="21" class="grayTd">&nbsp;Shipper Ref</td>
            
            <td width="10%" height="21" class="grayTd">&nbsp;Account</td>
            <td width="10%" height="21" class="grayTd">&nbsp;Tel</td>
            <td width="31%" height="21" class="grayTd">&nbsp;Address</td>
            <td width="10%" height="21" class="grayTd">&nbsp;Payer Account</td>
        </tr>
        <tr valign="TOP">
            
                <td class="whiteTdNormal" height="21" >&nbsp;</td>
                <td class="whiteTdNormal" height="21" >&nbsp;</td>
                <td class="whiteTdNormal" height="21" >&nbsp;</td>
                <td class="whiteTdNormal" height="21" >&nbsp;</td>
                <td class="whiteTdNormal" height="21" >&nbsp;</td>
                <td class="whiteTdNormal" height="21" >&nbsp;</td>
            
        </tr>
    </table >

    <table border="0" cellspacing="1" width="100%" >
        <tr >
            <td width="22%" class="grayTd" height="21" >&nbsp;Consignee</td>
            <td width="15%" class="grayTd" height="21" >&nbsp;Tel</td>
            <td class="grayTd" height="21" >&nbsp;Address</td>
            
        </tr>

        <tr valign="TOP">
        
            <td class="whiteTdNormal" height="21" >&nbsp;</td>
            <td class="whiteTdNormal" height="21"  >&nbsp;</td>
            <td class="whiteTdNormal" height="21" >&nbsp;</td>
            
        </tr>

        <tr align="left" valign="center">
            <td>&nbsp;</td>
        </tr>
    </table>

    
    <table border="0" cellspacing="1" width="100%" >
        <tr>
            <td colspan="3" class="blackHeadingLeft" width="100%" >  View Images  </td>
        </tr>
        <tr  valign="TOP" >
            <td width="33%" class="whiteTdNormal" height="21" >&nbsp;<a href="javascript:showImage( 'AWB', 'Null' )">View AirwayBills</a></td>
            <td width="33%" class="whiteTdNormal" height="21" >&nbsp;<a href="javascript:showImage( 'INV', 'Null' )">View Invoices</a></td>
            <td width="33%" class="whiteTdNormal" height="21" >&nbsp;<a href="javascript:showImage( 'POD', 'Null' )">View Proof of Delivery</a></td>
        </tr>
        <tr>
            <td colspan="3" align="right">&nbsp;</td>
        </tr>
    </table>
    
    
	    <table width="100%" border="0" cellpadding="0" cellspacing="0" >
	
	                            <td width="100%" valign="middle" nowrap >
	                            </td>
	
	                            <td valign="middle" nowrap align="right" ><div align="right">
	                            	<a href="#" onMouseUp= "swapImg(11);return true;"
	                            	            onMouseOut="swapImg(11);return true;"
	                                            onMouseDown="swapImg(12);return true;">
	                             	<img alt="Reverse Checkpoint Details( Ctrl+Shift+R )" src="/npts/buttons/Reverse.gif"
	                       	   			onClick="javascript:buttonClicked('reverse')" border=0 name="Reverse"></a></div>
	                            </td>
	                            <td valign="middle" nowrap >&nbsp;
	                            </td>
	
	                            <td valign="middle" nowrap align="right" ><div align="right">
	                            	<a href="#" onMouseUp= "swapImg(9);return true;"
	                            				onMouseOut="swapImg(9);return true;"
	                            				onMouseDown="swapImg(10);return true;">
	                       			<img alt="Cycle Shipment Details( Ctrl+Shift+C )" src="/npts/buttons/Cycle.gif"
	              						onClick="javascript:buttonClicked('cycle')" border=0 name="Cycle"></a></div>
	                       		</td>
	                            <td valign="middle" nowrap >&nbsp;
	                            </td>
	
	                            <td valign="middle" nowrap align="right" ><div align="right">
	                            	<a href="#" onMouseUp= "swapImg(13);return true;"
	                            				onMouseOut="swapImg(13);return true;"
	                            				onMouseDown="swapImg(14);return true;">
	                       			<img alt="Trace Request ( Ctrl+Shift+T) " src="/npts/buttons/Trace.gif"
	              						onClick="javascript:buttonClicked('trace')" border=0 name="Trace"></a></div>
	                       		</td>
	                       		<td valign="middle" nowrap >&nbsp;
	                            </td>
	
	                       		<td valign="middle" nowrap align="right" ><div align="right">
	                            	<a href="#" onMouseUp= "swapImg(17);return true;"
	                            				onMouseOut="swapImg(17);return true;"
	                            				onMouseDown="swapImg(18);return true;">
	                       			<img alt="TTQuery Request( Ctrl+Shift+Q ) " src="/npts/buttons/TTQuery.gif"
	              						onClick="javascript:buttonClicked('ttQuery')" border=0 name="TTQuery"></a></div>
	                       		</td>
	                       		<td valign="middle" nowrap >&nbsp;
	                            </td>
	
	                       		<td valign="middle" nowrap align="right" ><div align="right">
	                            	<a href="#" onMouseUp= "swapImg(3);return true;"
	                            				onMouseOut="swapImg(3);return true;"
	                            				onMouseDown="swapImg(4);return true;">
	                       			<img alt="Help( Ctrl+Shift+H ) " src="/npts/buttons/Help.gif"
	              						onClick="javascript:buttonClicked('help')" border=0 name="Help"></a></div>
	                       		</td>
	                        </table>

		
    <table border="0" cellspacing="0" width="100%" >
        <tr>
            <td align="right"></td>
        </tr>
    </table>

    

    <table border="0" cellspacing="0" width="100%" >
        <tr>
            <td  class="blackHeadingLeft" width="100%">&nbsp;Checkpoint Details</td>
            <td></td>
        </tr>
    </table>

    <table border="0" cellspacing="0" width="100%" >
        <tr  valign="TOP" >
            <td class="grayTd" nowrap height="21" >&nbsp;No of Distinct Checkpoints:
            </td>
            <td class="grayTdNormal" height="21" nowrap>&nbsp;1</td>
            <td class="grayTdNormal"  height="21" width="2%">&nbsp;</td>
            <td class="grayTd" nowrap height="21" >&nbsp;Duplicated Checkpoints Query:
            </td>
            <td class="grayTdNormal" height="21" nowrap >
            &nbsp;No</td>
            
            
            <td class="grayTdNormal" height="21"  width="2%">&nbsp;</td>
            <td class="grayTd" height="21" nowrap>&nbsp;Last Checkpoint Summary:
            </td>
            <td class="grayTdNormal" height="21" nowrap  >&nbsp;Shipment Ppwk Imaged
            on 18Jan2012 15:23:43 at LEJ</td>
            
            <td class="grayTdNormal" height="21" width="100%">&nbsp;</td>
        </tr>
    </table>

    <table border="0" cellspacing="1" width="100%" >
        <tr align="left" >
            <td width="11%" class="blackHeading">Checkpoint</td>
            <td width="4%" class="blackHeading">Stn</td>
            <td width="5%" class="blackHeading">Location</td>
            <td width="12%" class="blackHeading">Date/Time</td>
            <td width="3%" class="blackHeading">Pcs</td>
            <td width="6%" class="blackHeading">Route</td>
            <td width="5%" class="blackHeading">Cycle</td>
            <td width="8%" class="blackHeading">Stat</td>
            <td width="8%" class="blackHeading">Pgln</td>
            <td width="7%" class="blackHeading">Count</td>
            <td width="5%" class="blackHeading">Last</td>
            <td width="10%" class="blackHeading">Remarks</td>
            <td width="15%" class="blackHeading">Comments</td>
        </tr>
    
        
        <tr align="left" valign="TOP" >
            
            <td class="grayTdNormal" height="21" >&nbsp;
                <a href="javascript:checkPointClicked('0')" >Shipment Ppwk Imaged</a>
            </td>
            
            <td class="grayTdNormal" height="21" >&nbsp;LEJ</td>
            <td class="grayTdNormal" height="21" >&nbsp;HUB</td>
            <td class="grayTdNormal" height="21" >&nbsp;18Jan2012 15:23:43</td>
            <td class="grayTdNormal" height="21" >&nbsp;0</td>
            <td class="grayTdNormal" height="21" >&nbsp; </td>
            <td class="grayTdNormal" height="21" >&nbsp; </td>
            <td class="grayTdNormal" height="21" >&nbsp;IA</td>

        
            <td class="grayTdNormal" height="21">&nbsp;</td>
        

        
            <td class="grayTdNormal" height="21">&nbsp;1</td>
        
            <td class="grayTdNormal" height="21">&nbsp;</td>
            <td class="grayTdNormal" height="21">&nbsp;</td>
            <td class="grayTdNormal" height="21">&nbsp;</td>
        </tr>
        
    </table>
    </td>
  </table>

</form>
</body>
</html>
```
Problem ist folgendes:
Ich kann zwar definieren von welcher Datei ich die Daten auslesen möchte, in dem ich sie vorher in der Tabelle tblAWB einlesen, allerdings gibt er mir nicht den spezifischen Inhalt aus.

Mir geht es darum, das in der HTML folgendes eingelesen wird:

No of Distinct Checkpoints <- gibt die Anzahl der Inhaltszeilen an

Und den Inhalt dieser besagten Zeilen will ich gerne ausgegeben haben.
Das soll das Modul solange tun bis die entsprechende Anzahl an Zeilen eingelesen wurde und dann soll er zur nächsten Datei springen.

Danke schonmal im vorraus


----------



## sheel (20. Januar 2012)

Yaslaw hat gesagt.:


> Kannst du bitte dein Code formatiert in VB-Tags setzen? Dann wird er lesbar


Das auch bitte bei HTML/JS machen, vor allem bei solchen Mengen.
[code=javascript]...[/code]
usw...

Eine Liste der Möglichkeiten ist in meiner Signatur verlinkt.


----------

