Set db = Server.CreateObject("ADODB.Connection")
db.Open "Provider=SQLOLEDB;Data Source=192.168.0.4\taeyo;Initial Catalog=MyDB;user ID=sa;password=..;"
'db.Open "MySite", "sa", ".."
'db.Open("MySiteDB")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open SQL, db
If IsNULL(rs(0)) Then
number = 1
else
number = rs(0) + 1
End If
rs.Close
Set rs = Nothing
db.Execute SQL2
db.close
Set db = Nothing
Set db = Server.CreateObject("ADODB.Connection")
db.Open("MySiteDB")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open SQL,db,1
if rs.BOF or rs.EOF then
..
else
Do until rs.EOF
.. rs("..") ..
rs.MoveNext
loop
end if
rs.Close
Set rs = Nothing
db.close
Set db = Nothing