%@ LANGUAGE=VBSCRIPT%>
|
Below is your DSN-Less Connection to the Database you Specified.
You should be able to Cut and Paste this into your code and test
the connection to your Database.
|
||
| Database Connection: | ||
|
||
| Active Server Page Code Example | ||
--- BEGIN CODE COPY HERE ---->
<%@ Language=VBScript %>
<%
' Dim the Recordset Object
Dim rsADO
' Define the Connection String From Above
ConnectionString = <%=sConnection%>
' Create the Object
Set rsADO = Server.CreateObject("ADODB.Recordset")
' Define the SQL Statement
' (REPLACE TABLENAME WITH THE TABLE NAME
' IN YOUR DATABASE)
Source = "SELECT * FROM TABLENAME"
' Open the Recordset
rsADO.Open Source, ConnectionString
' Display the Fields Returned
' (PUT YOUR FIELD NAMES WHERE FieldName1 and
' FieldName2 Appear)
Do while(not rsADO.EOF)
Response.Write rsADO("FieldName1")
Response.Write rsADO("FieldName2")
rsADO.MoveNext
Loop
' DeAllocate the Object to Free Server Memory
set rsADO = nothing
%>
<--- END CODE COPY HERE ----
|
||
|
||
| Create another DSN-LESS Connection | ||
|
|
||
| Choose your Database Type: | ||
| Database Location (Relative - Non SQL): | ||
| SQL Server Name (SQL Only): | ||
| Database Name (SQL Only): | ||
| User Name: | ||
| Password: | ||
![]()
This function demonstrates how to use DSN-Less strings on connecting database.