set adocon=Server.Createobject("adodb.connection")
adoconn.Open"Driver={Microsoft Access Driver(*.mdb)};DBQ="& _
Server.MapPath("数据库所在路径")
set adocon=Server.Createobject("adodb.connection")
adocon.open"Provider=Microsoft.Jet.OLEDB.4.0;"& _
"Data Source=" & Server.MapPath("数据库所在路径")
set adocon=server.createobject("adodb.recordset")
adocon.Open"Driver={SQL Server};Server=(Local);UID=***;PWD=***;"& _
"database=数据库名;"
set adocon=Server.Createobject("adodb.connection")
adocon.open"provider=SQLOLEDB.1;Data Source=RITANT4;"& _
"user ID=***;Password=***;"& _
"inital Catalog=数据库名"
set adocon=Server.Createobject("adodb.connection")
adocon.open"Driver={microsoft odbc for oracle};server=oraclesever.world;uid=admin;pwd=pass;"
set adocon=Server.Createobject("adodb.connection")
adocon.open"Provider=OraOLEDB.Oracle;data source=dbname;user id=admin;password=pass;"
set adocon=Server.Createobject("adodb.connection")
adocon.open"Driver={microsoft dbase driver(*.dbf)};driverid=277;dbq=------------;"
set adocon=Server.Createobject("adodb.connection")
adocon.open"Driver={mysql};database=yourdatabase;
uid=username;pwd=yourpassword;option=16386;"
set adocon=Server.Createobject("adodb.connection")
adocon.open"Driver={microsoft Visual Foxpro driver};sourcetype=DBC;sourceDB=*.dbc;Exclusive=No;"
set adocon=Server.Createobject("adodb.connection")
adocon.open"Driver={microsoft text driver(*.txt; *.csv)};dbq=-----;"&_
"extensions=asc,csv,tab,txt;Persist SecurityInfo=false;"
set adocon=Server.Createobject("adodb.connection")
adocon.open"Provider=microsof.jet.oledb.4.0;data source=your_path;"&_
"Extended Properties'text;FMT=Delimited'"
select * from book where author=’cancer’
select * from book where id=1
select * from book where pub_date=#2002-1-7# (Access)
select * from book where pub_date=’2002-1-7’ (SQL Server)
strau=request.form("author")
strsql="select * from book where author=’"&strau&"’"
intID=request.form("id")
strsql="select * from book where id="&intID
strsql="select * from book where id='"&intID&"'"
Insert into table(field1,field2,....) Values (value1,value2,....)
insert into book (bookno,author,bookname) values (’CF001’,’cancer’,’Cancer无组件上传程序’)
strno=request.form("bookno")
strau=request.form("author")
strname=request.form("bookname")
strsql="insert into book (bookno,author,bookname) values (’"&strno&"’,’"&strau&"’,’"&strname&"’)"
rs.addnew
rs("field1").value=value1
rs("field2").value=value2
...
rs.update
update table set field1=value1,field2=value2,...where fieldx=valuex
update book set author=’babycrazy’ where bookno=’CF001’
strno=request.form("bookno")
strau=request.form("author")
strsql="update book set author=’"&strau&"’ where bookno=’"&strno"’"
rs("field1").value=value1
rs("field2").value=value2
...
rs.update
strno=request.form("bookno")
strau=request.form("author")
set adocon=server.createobject("adodb.connection")
adocon.open "Driver={Microsoft Access Driver(*.mdb)};DBQ=" & _
Server.Mappath=("/cancer/cancer.mdb")
strsql="select * from book where bookno=’"&strno&"’"
set rs=server.createobject("adodb.recordset")
rs.open strsql,adconn,1,3
if not rs.eof then ’如果有此记录的话
rs("author").value=strau
rs.update
end if
rs.close
set rs=nothing
adocon.close
set adocon=nothing
Delete table where field=value
delete book where author=’cancer’