HighTechTalks DotNet Forums  

RE: SQL Server with ASP

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss RE: SQL Server with ASP in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Manish.net
 
Posts: n/a

Default RE: SQL Server with ASP - 09-13-2004 , 08:37 AM






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
--


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.