Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%
- Dim dbHost, dbUser, dbPass, dbName
- Dim dbConnectionString, dbConnection, dbRecordset, SQL
- dbHost = "localhost"
- dbUser = "root"
- dbPass = ""
- dbName = "aspairlinessystem"
- Set dbConnection = Server.CreateObject("ADODB.Connection")
- Set dbRecordset = Server.CreateObject("ADODB.Recordset")
- dbConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};" &_
- "SERVER=" & dbHost &_
- ";DATABASE=" & dbName &_
- ";UID=" & dbUser &_
- ";PASSWORD=" & dbPass &_
- ";OPTION=3;"
- dbConnection.Open dbConnectionString
- 'Connection has been established
- %>
- <%
- SQL = "SELECT * FROM CustomerInformation"
- dbRecordset.Open SQL, dbConnection
- If Not dbRecordset.EOF Then
- %>
- <table border="1">
- <tr>
- <th>CustomerNo</th><th>CustomerName</th><th>Address</th><th>City</th><th>State</th><th>Country</th><th>PinCode</th><th>EmailID</th><th>Sex</th><th>Age</th><th>Phone</th>
- </tr>
- <%Do While Not dbRecordset.EOF %>
- <tr>
- <td><%=dbRecordset.Fields("CustomerNo") %></td><td><%=dbRecordset.Fields("CustomerName") %></td><td><%=dbRecordset.Fields("Address") %></td><td><%=dbRecordset.Fields("City") %></td><td><%=dbRecordset.Fields("State") %></td><td><%=dbRecordset.Fields("Country") %></td><td><%=dbRecordset.Fields("PinCode") %></td><td><%=dbRecordset.Fields("EmailID") %></td><td><%=dbRecordset.Fields("Sex") %></td><td><%=dbRecordset.Fields("Age") %></td><td><%=dbRecordset.Fields("Phone") %></td>
- </tr>
- <%dbRecordset.MoveNext
- Loop %>
- </table>
- <%Else %>
- No Records Defined
- <%End If %>
- <%
- If ddRecordset.State <> 0 Then
- dbRecordset.Close
- Set dbRecordset = Nothing
- End If
- dbConnection.Close
- Set dbConnection = Nothing
- %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement