% Option Explicit Response.Buffer = True ' Function to log errors Sub LogError(message) Dim fso, logFile Set fso = Server.CreateObject("Scripting.FileSystemObject") On Error Resume Next Set logFile = fso.OpenTextFile(Server.MapPath("error.log"), 8, True) logFile.WriteLine Now & ": " & message logFile.Close Set logFile = Nothing Set fso = Nothing On Error GoTo 0 End Sub ' Database connection configuration Dim conn, rs, Cwb, sql, errorMsg Set conn = Server.CreateObject("ADODB.Connection") conn.ConnectionString = "Provider=SQLOLEDB;Data Source=192.168.1.2,1433;Initial Catalog=cims;User Id=sa2;Password=asdf@#12345;" On Error Resume Next conn.Open If conn.Errors.Count > 0 Then errorMsg = "Connection failed: " & conn.Errors(0).Description LogError errorMsg Response.Write "
CWB | Client | Destination | Type | Pieces | Weight | Date | Zone | Country | Exchange Rate | Rate | Amount | Picked | Invoice No | MAWB | Consignee | Via | CWB Type | Charge Rate | Sales Rep | Name | Address 1 | Address 2 | Address 3 | PKR Type | PKR | Remarks |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
<%=Server.HTMLEncode(rs("Cwb") & "")%> | <%=Server.HTMLEncode(rs("Client") & "")%> | <%=Server.HTMLEncode(rs("Destination") & "")%> | <%=Server.HTMLEncode(rs("Type") & "")%> | <%=Server.HTMLEncode(rs("Pieces") & "")%> | <%=Server.HTMLEncode(rs("weight") & "")%> | <%=Server.HTMLEncode(rs("date") & "")%> | <%=Server.HTMLEncode(rs("Zone") & "")%> | <%=Server.HTMLEncode(rs("Country") & "")%> | <%=Server.HTMLEncode(rs("Exchange_Rate") & "")%> | <%=Server.HTMLEncode(rs("Rate") & "")%> | <%=Server.HTMLEncode(rs("Amount") & "")%> | <%=Server.HTMLEncode(rs("Picked") & "")%> | <%=Server.HTMLEncode(rs("Invoice_No") & "")%> | <%=Server.HTMLEncode(rs("Mawb") & "")%> | <%=Server.HTMLEncode(rs("Consignee") & "")%> | <%=Server.HTMLEncode(rs("via") & "")%> | <%=Server.HTMLEncode(rs("cwbtype") & "")%> | <%=Server.HTMLEncode(rs("ChgRate") & "")%> | <%=Server.HTMLEncode(rs("salesrep") & "")%> | <%=Server.HTMLEncode(rs("name") & "")%> | <%=Server.HTMLEncode(rs("add1") & "")%> | <%=Server.HTMLEncode(rs("add2") & "")%> | <%=Server.HTMLEncode(rs("add3") & "")%> | <%=Server.HTMLEncode(rs("pkrtype") & "")%> | <%=Server.HTMLEncode(rs("pkr") & "")%> | <%=Server.HTMLEncode(rs("Remarks") & "")%> |