|
|
|
|
|
| | |
|
Active Server Pages asp source code database MS SQL MS Access .mdb adovbs.inc cookies calendar codes sql commands scripts asp programming tutorials iis web server components CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: Connecting to a DB |
From: |
Gie Gie |
Date: |
2/6/1999 11:32:27 AM |
IP: |
202.77.161.34 |
Actually you need to establish a connection before you execute a SQL
<OBJECT RUNAT=Server ID=Conn progid="ADODB.Connection"></OBJECT>
You can incl. the above object in your asp then use the following code to open the database
Conn.Open "DSN Name"
Set rs=Conn.Execute( "Select * from table" )
and you can also retrieve the infomation by
rs("field_name")
These are the method to retrieve execute SQL in ASP.
And you can use RecordSet to Insert or update a db.
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = "DSN=user_DSN_name;"
rs.Open( "Select * from Table" )
|
Previous Message
|
|
|
|
|
|
|
|
|
|
|
|