1 <%
2 Dim cnnSimple ' ADO connection
3 Dim rstSimple ' ADO recordset
4 Set cnnSimple = Server.CreateObject("ADODB.Connection")
5 ' DSNLess
6 cnnSimple.Open "Provider=SQLOLEDB;Data Source=YOURDBSERVER;" _
7 & "Initial Catalog=YOURDBNAME;User Id=YOURUSERID;Password=YOURPASSWORD;" _
8 & "Connect Timeout=15;Network Library=dbmssocn;"
9 Set rstSimple = cnnSimple.Execute("SELECT * FROM tbltest")
10 %>
11 <P> Connecting to SQL DB with DSNless connection P>
12 <TABLE border=1><%
13 Do While Not rstSimple.EOF
14 %><TBODY><TR><TD><%= rstSimple.Fields("id").Value %>TD><TD>%>= rstSimple.Fields("name").Value %>TD>TR><%
15 rstSimple.MoveNext
16 Loop
17 %>TBODY>TABLE>
18 <%
19 rstSimple.Close
20 Set rstSimple = Nothing
21 cnnSimple.Close
22 Set cnnSimple = Nothing
23 %>
24
25
- Home
-
Store
- Browse All
- Linux Shared Hosting Plan
- Linux Cloud Server
- Linux Dedicated Server
- Linux Reseller Web Hosting Plan
- Windows Shared Hosting Plan
- Windows Cloud Server
- Windows Dedicated Server
- Windows Reseller Web Hosting Plan
- Sharepoint Hosting
- VPS Server
- SSL Certificates
- SEO Services
- Email Hosting
- Sitelock
- webhostforasp.net.au
- Register a New Domain
- Transfer Domains to Us
- Announcements
- Knowledgebase
- Network Status
- Affiliates
- Contact Us
-
More