Hi,
There are two ways to connect i.e with DSN and without DSN.
Following is the example of DSN based.
Dim MyConn ' Connection Name
Dim RS ' Recordset Variable
Dim SQL ' Variable for SQL statement
Set MyConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
MyConn.Open "DSN=DSNName;UID=UserID;PWD=Password;"
SQL="Select fieldname1, fieldname2 From tablename "
For information about what above code means see below
http://www.4guysfromrolla.com/webtech/111698-1.shtml
Another good link is -:
http://www.experts-exchange.com/Web/..._21023249.html
----------------------------------------------------------------------
For DSN less check following link
http://www.tutorial-web.com/asp/database/dsnless.asp
"Lev Burov" wrote:
Quote:
Hi everyone,
Can anyone give a code snippet in VBScript to show me how to connect to a
table in Microsoft SQL Server database through the ASP web page. A simple
SELECT query example will be sufficient.
Thank you
-- |