190| 0
|
经典ASP代码大集合 |
当以上信息被提交后,就可以按照下面的代码进行打印了。 We will now use the VBScript FileSystemObject object and the WSH Net Set objFS = CreateObject("Scripting.FileSystemObject") Response.Write(" Response.Write(" 打印消息送出: | " ) Response.Write(" " & strMessage & " | Response.Write(" 网络打印机路径: | >") Response.Write(" " & strPrinterPath & " | Response.Write(" 登录帐号: | ") Response.Write(" " & strUsername & " | Response.Write(" |
效果:
①.当关闭IIS的缓冲功能,访问该页面时出错
a
答复对象 错误 'ASP 0156 : 80004005'
头错
/course/response_buffer.asp,行3
HTTP 头已经写入到 客户浏览器。任何 HTTP 头的修改必须在写入页内容之前。
②.当关闭IIS的缓冲功能,去掉文件第一行的注释,则页面重定向成功
③.当打开IIS的缓冲功能,无论是否去掉文件第一行的注释,页面重定向都成功
问题:如何保护自己的ASP源代码不泄露?
答:下载微软的windows script encoder,对ASP的脚本和客户端javascript、vbscript脚本进行加密。客户端脚本加密后,只有ie5以上的版本才能执行,服务器端脚本加密后,只有服务器上安装有script engine 5(装ie5即可)才能解释执行。
问题:为什么global.asa文件总是不起作用?
答:只有把global.asa文件放在web发布目录某个站点的根目录下它才有效,放在发布目录的某个子目录下不起作用。另外,也可以使用iis4的internet service manager把某个子目录设置为站点。
问题:为什么ASP文件总不解释执行?
答:在iis服务器上没有给ASP文件以脚本解释的权限,所以ASP文件没有被web服务器作为脚本代码进行解释执行,而被当成一般页面文件了。建议在web发布目录中建立一个ASP目录,把所有ASP文件存放在此目录下,把ASP目录赋予脚本解释权限。
问题:ASP文件中使用response.redirect(url)时导致错误“the http headers are already written to the client browser. any http header modifications must be made before writing page content”,请问如何解决?
答:此错误为http标题在写入页内容之后,写到了客户浏览器中。任何http标题的修改必须在写入页内容之前进行,解决的方法为在ASP文件最开头加入response.buffer = true,在文件的结尾加入response.flush。
问题:为什么session有时候会消失?
答:session很像临时的cookie,只是其信息保存在服务器上(客户机上保存的是sessionid)。session变量消失有几种可能,如:使用者的浏览器不接受cookie,因为session依赖于cookie才能跟踪用户;session在一段时间后过期了,缺省为20分钟,如果希望更改,可以通过设置microsoft management console的web directory→properties→virtual directory→application settings→configuration→app options→session timeout选项来改变session的超时时间,也可以在ASP脚本中设定,如session.timeout=60,可设定超时时间为60分钟。
问题:怎样才能知道访问者的一些信息?
答:通过request.servervariables("http—user—agent")获得访问者浏览器的类型;request.servervariables("remote—addr")可获得访问者的ip地址;而访问者的语言环境可通过request.servervariables("http—accept—language")来获得。
问题:怎样才能将query string从一个ASP文件传送到另一个ASP文件?
答:前一个ASP文件加入下列代码:response.redirect("second.ASP?"&request.servervariables("query—string"))即可。
问题:ASP中如何控制cookies?
答:若想写入cookies可用:response.cookies("待写入的coookies名称")=待写入数据。读取cookies则使用:读取数据=request.cookies("待读的cookies名称")。
注意,写入cookies的response.cookies程序段必须放在〈html〉标记之前,且不可以有任何的其它html代码。另外,cookies中必须使用expires设定有效期,cookies才能真正地写入客户端硬盘中,否则只是临时的。
问题:怎样实现用ASP发送邮件?
答:用户需装上windows nt option pack的smtp service功能。实现代码如下:
〈%
set mail = server.createobject("cdonts.newmail")
mail.to ="abc@xxx.com"
mail.from ="yourmail@xxx.com"
mail.subject ="主题"
mail.body ="e-mail内容"
mail.send
%〉
问题:ASP与数据库连接一定要在服务器端设置dsn吗?
答:不一定,ASP与服务器的数据库连接有两种方法,一种为通过dsn建立连接,另一种不用dsn建立连接。通过dsn连接数据库需要服务器的系统管理员在服务器的控制面板中的odbc中设置一个dsn。如果没有在服务器上设置dsn,只要知道数据库文件名(比如access、paradox、foxpro的数据库)或者数据源名(如sqlserver的数据库)就可以访问数据库,直接提供连接所需的参数即可。
连接代码如下:
set conn=server.createobject("adodb.connection")
connpath="dbq="&server.mappath("yourtable.mdb")
conn.open"driver={microsoft access driver (.mdb)};"&connpath
set rs=conn.execute("selectfrom authors")
问题:如何从一页到另一页传递变量?
答:用hidden表单类型来传递变量。
〈form method="post"action="mynextpage.ASP"〉
〈% for each item in request.form %〉
〈input namee="〈%=item%〉"type="hidden"
value="〈%=server.htmlencode(request.form(item)) %〉"〉
〈% next %〉
〈/form〉
用session来保存变量。
〈%session("bh")= request.form ("bh")%〉
用querystring保存变量。
〈a herf="action.ASP?bh=10"〉查询〈/a〉
〈%request. querystring ("bh")%〉
问题:如何用ASP实现在线人数统计?
答:在线人数是指一个时段内的访客人数统计,时间的长短是由设计者设定的。
在这个时段内,各个不同ip访问本站点的总数,就是当前的线上人数。在ASP中,使用session对象来实现统计,实现代码如下:
golobal.asa文件
〈script language="vbscript"runat="server"〉
sub session—onstart
application("online")=application("online")+1
end sub
sub session—onend
application("online")=application("online")-1
end sub
sub application—onstard
application("online")=0
end sub
sub application—onend
application("online")=0
end sub
〈/script〉
online.ASP文件内容
〈% tmp=application("online")
tmp=cstr(tmp)
dim disp(20)
dim images(20)
dbbits=len(tmp)
for i= 1 to dbbits
disp(i)=left(right(tmp,i),i-(i-1))
next
for i=dbbits to 1 step -1
images(i)="〈img src="&"http://xxxx.com.cn/pic"&"/"&disp(i)&".gif〉"
response.write"document.write(′"&images(i)&"′);"
next %〉
问题:ASP程序运行的时间如何计算?
答:确定ASP程序的执行时间的代码如下所示:
〈%
dim t1,t2
t1=now()
′被检测的ASP代码
t2=now()
response.write"运行这段ASP代码用了"&cstr(cdbl((t2-t1)*24*60*60))&"秒"
%〉
一个操作读写已存在Excel文件的例子
Set xlApp = Server.CreateObject("Excel.Application")
strSource=FilePath & "Test.xls"'打开一个已经存在的test.xls文件,filepath为物理绝对路径
xlApp.Workbooks.Open(strSource)
Set xlbook = xlApp.ActiveWorkBook '打开book
Set xlsheet = xlbook.Worksheets(1) '打开其中的一个sheet
xlsheet.cells(1,1).value="Test" '通过设置cell(i,j)里面的i,j来访问sheet里面任意一个cell
xlbook.Save '保存该excel文件
xlbook.Saveas FilePath & "Test2.xls" '另存一个文件
Set xlsheet=nothing '一定要关闭,否则以后会一直存在一个无法释放的excel进程
Set xlbook=nothing
xlApp.quit
asp运行端的一些设置
1Excel文件所在的路径目录,要让IUSER_即asp运行的用户有读写权限,否则
会报错。
2服务器端还必须要设置COM组件的操作权限。在命令行键入“DCOMCNFG”,
进入COM组件配置界面,选择Microsoft Excel后点击属性按钮,将三个单选
项一律选择自定义,编辑中将Everyone加入所有权限。保存完毕后重新启动
服务器。
如何使用事务处理、存储过程和视图?
⑴.使用存储过程
①.定义好存储过程
CREATE PROCEDURE [output_1]
@sid int output
AS
set @sid=2
CREATE PROCEDURE [return_1]
(@user_name varchar(40),@password varchar(20))
AS
if exists(select id from user_info where user_name=@user_name and password=@password)
return 1
else
return 0
CREATE PROCEDURE [user_info_1]
(@user_name varchar(40),@password varchar(20))
AS
select id from user_info where user_name=@user_name and password=@password
CREATE PROCEDURE [user_info_2]
(@user_name varchar(40),@password varchar(20))
AS
SET XACT_ABORT ON
BEGIN TRANSACTION
delete from user_info where user_name=@user_name and password=@password
COMMIT TRANSACTION
SET XACT_ABORT OFF
CREATE PROCEDURE [user_info_3] AS
select * from user_info
②.在Asp中调用
use_proc.asp
<%
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open "course_dsn","course_user","course_password"
'使用recordset调用带两个输入参数和返回纪录集的存储过程
'CREATE PROCEDURE [user_info_1]
'(@user_name varchar(40),@password varchar(20))
'AS
'select id from user_info where user_name=@user_name and password=@password
response.write "普通的调用方法:
"
set rs=server.createobject("adodb.recordset")
sql="user_info_1 '"&request.querystring("user_name")&"','"&request.querystring("password")&"'"
rs.open sql,conn,1,1
response.write rs("id")&"
"
rs.close
'使用recordset调用无输入参数,返回纪录集的存储过程,可以使用recordcount等属性
'CREATE PROCEDURE [user_info_3] AS
'select * from user_info
response.write "
返回纪录集,可以使用recordcount等属性:"
sql="exec user_info_3"
rs.open sql,conn,1,1
for i=1 to rs.recordcount
response.write "
"&rs("user_name")
rs.movenext
next
rs.close
set rs=nothing
'使用command调用带输出参数的存储过程
'CREATE PROCEDURE [output_1]
'@sid int output
'AS
'set @sid=2
response.write "
调用带输出参数的存储过程:
"
set cmd=server.createobject("adodb.command")
cmd.activeconnection=conn
cmd.commandtext = "output_1"
cmd.parameters.append cmd.createparameter("@sid",adinteger,adparamoutput)
cmd("@sid")=10
cmd.execute()
bbb=cmd("@sid")
response.write bbb&"
"
set cmd=nothing
'使用command调用带两个输入参数和返回值的存储过程
'CREATE PROCEDURE [return_1]
'(@user_name varchar(40))
'AS
'if exists(select id from user_info where user_name=@user_name)
'return 1
'else
'return 0
response.write "
调用带两个输入参数和返回值的存储过程:
"
set cmd=server.createobject("adodb.command")
cmd.activeconnection=conn
cmd.commandtype = adcmdstoredproc
cmd.commandtext = "return_1"
cmd.parameters.append cmd.createparameter("@return_value",adinteger,adparamreturnvalue)
cmd.parameters.append cmd.createparameter("@user_name",advarchar,adparaminput,40)
cmd.parameters.append cmd.createparameter("@password",advarchar,adparaminput,20)
cmd("@user_name")="tuth"
cmd("@password")="yyuyu"
cmd.execute()
rrr=cmd("@return_value")
response.write rrr
set cmd=nothing
conn.close
set conn=nothing
%>
效果:
访问http://10.1.43.238/course/use_proc.asp?user_name=ahyi&password=ttt时,出现如下
普通的调用方法:
12
返回纪录集,可以使用recordcount等属性:
ahyi
tet
tuth
调用带输出参数的存储过程:
2
调用带两个输入参数和返回值的存储过程:
1
注意:若存储过程无参数,则调用的sql语句直接为存储过程名,一个参数为“存储过程名 参数”,若是多个参数,则“存储过程名 参数1,参数2,……,参数n”;如果在sql语句中加入exec,则在返回的记录集中可以使用recordcount等属性;如果想获得存储过程的返回值或输出参数,可以使用command对象。
⑵.使用事务处理
①.Asp内嵌的事务支持
例子:
use_transaction_1.asp
<%
'Asp中使用事务
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open "course_dsn","course_user","course_password"
conn.begintrans '开始事务
sql="delete from user_info"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,3
if conn.errors.count>0 then '有错误发生
conn.rollbacktrans '回滚
set rs=nothing
conn.close
set conn=nothing
response.write "交易失败,回滚至修改前的状态!"
response.end
else
conn.committrans '提交事务
set rs=nothing
conn.close
set conn=nothing
response.write "交易成功!"
response.end
end if
%>
②.数据库级的事务
i.创建存储过程
CREATE PROCEDURE [user_info_2]
(@user_name varchar(40),@password varchar(20))
AS
SET XACT_ABORT ON
BEGIN TRANSACTION
delete from user_info where user_name=@user_name and password=@password
COMMIT TRANSACTION
SET XACT_ABORT OFF
ii.在Asp中调用
use_transaction_2.asp
<%
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open "course_dsn","course_user","course_password"
sql="user_info_2 '"&request.querystring("user_name")&"','"&request.querystring("password")&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
set rs=nothing
conn.close
set conn=nothing
%>
讨论:两种方式的优劣?
⑶.使用视图
在数据库中定义好视图之后,在Asp中如同使用一个表一样来使用视图
各类型数据的导入与导出:
******* 导出到excel
EXEC master..xp_cmdshell 'bcp SettleDB.dbo.shanghu out c:\temp1.xls -c -q -S"GNETDATA/GNETDATA" -U"sa" -P""'
/*********** 导入Excel
select * from openrowset('MicroSoft.Jet.OleDB.4.0',
'Excel 5.0;HDR=yes;Database=c:\test.xls',sheet1$)
--------------------------------------------------------
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\test.xls";User ID=Adminassword=;Extended properties=Excel 5.0')...xactions
SELECT cast(cast(科目编号 as numeric(10,2)) as nvarchar(255))+' ' 转换后的别名
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\test.xls";User ID=Adminassword=;Extended properties=Excel 5.0')...xactions
/** 导入文本文件
EXEC master..xp_cmdshell 'bcp "dbname..tablename" in c:\DT.txt -c -Sservername -Usa -Ppassword'
/** 导出文本文件
EXEC master..xp_cmdshell 'bcp "dbname..tablename" out c:\DT.txt -c -Sservername -Usa -Ppassword'
或
EXEC master..xp_cmdshell 'bcp "Select * from dbname..tablename" queryout c:\DT.txt -c -Sservername -Usa -Ppassword'
导出到TXT文本,用逗号分开
exec master..xp_cmdshell 'bcp "库名..表名" out "d:\tt.txt" -c -t ,-U sa -P password'
BULK INSERT 库名..表名
FROM 'c:\test.txt'
WITH (
FIELDTERMINATOR = ';',
ROWTERMINATOR = '\n'
)
--/* dBase IV文件
select * from
OPENROWSET('MICROSOFT.JET.OLEDB.4.0'
,'dBase IV;HDR=NO;IMEX=2;DATABASE=C:\','select * from [客户资料4.dbf]')
--*/
--/* dBase III文件
select * from
OPENROWSET('MICROSOFT.JET.OLEDB.4.0'
,'dBase III;HDR=NO;IMEX=2;DATABASE=C:\','select * from [客户资料3.dbf]')
--*/
--/* FoxPro 数据库
select * from openrowset('MSDASQL',
'Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=c:\',
'select * from [aa.DBF]')
--*/
/**************导入DBF文件****************/
select * from openrowset('MSDASQL',
'Driver=Microsoft Visual FoxPro Driver;
SourceDB=e:\VFP98\data;
SourceType=DBF',
'select * from customer where country != "USA" order by country')
go
/***************** 导出到DBF ***************/
如果要导出数据到已经生成结构(即现存的)FOXPRO表中,可以直接用下面的SQL语句
insert into openrowset('MSDASQL',
'Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=c:\',
'select * from [aa.DBF]')
select * from 表
说明:
SourceDB=c:\ 指定foxpro表所在的文件夹
aa.DBF 指定foxpro表的文件名.
/*************导出到Access********************/
insert into openrowset('Microsoft.Jet.OLEDB.4.0',
'x:\A.mdb';'admin';'',A表) select * from 数据库名..B表
/*************导入Access********************/
insert into B表 selet * from openrowset('Microsoft.Jet.OLEDB.4.0',
'x:\A.mdb';'admin';'',A表)
********************* 导入 xml 文件
DECLARE @idoc int
DECLARE @doc varchar(1000)
--sample XML document
SET @doc ='
Happy Customer.
'
-- Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @doc
-- Execute a SELECT statement using OPENXML rowset provider.
SELECT *
FROM OPENXML (@idoc, '/root/Customer/Order', 1)
WITH (oid char(5),
amount float,
comment ntext 'text()')
EXEC sp_xml_removedocument @idoc
邹健的
/********************导整个数据库*********************************************/
用bcp实现的存储过程
/*
实现数据导入/导出的存储过程
根据不同的参数,可以实现导入/导出整个数据库/单个表
调用示例:
--导出调用示例
----导出单个表
exec file2table 'zj','','','xzkh_sa..地区资料','c:\zj.txt',1
----导出整个数据库
exec file2table 'zj','','','xzkh_sa','C:\docman',1
--导入调用示例
----导入单个表
exec file2table 'zj','','','xzkh_sa..地区资料','c:\zj.txt',0
----导入整个数据库
exec file2table 'zj','','','xzkh_sa','C:\docman',0
*/
if exists(select 1 from sysobjects where name='File2Table' and objectproperty(id,'IsProcedure')=1)
drop procedure File2Table
go
create procedure File2Table
@servername varchar(200)--服务器名
,@username varchar(200)--用户名,如果用NT验证方式,则为空''
,@password varchar(200)--密码
,@tbname varchar(500)--数据库.dbo.表名,如果不指定:.dbo.表名,则导出数据库的所有用户表
,@filename varchar(1000)--导入/导出路径/文件名,如果@tbname参数指明是导出整个数据库,则这个参数是文件存放路径,文件名自动用表名.txt
,@isout bit--1为导出,0为导入
as
declare @sql varchar(8000)
if @tbname like '%.%.%' --如果指定了表名,则直接导出单个表
begin
set @sql='bcp '+@tbname
+case when @isout=1 then ' out ' else ' in ' end
+' "'+@filename+'" /w'
+' /S '+@servername
+case when isnull(@username,'')='' then '' else ' /U '+@username end
+' /P '+isnull(@password,'')
exec master..xp_cmdshell @sql
end
else
begin--导出整个数据库,定义游标,取出所有的用户表
declare @m_tbname varchar(250)
if right(@filename,1)<>'\' set @filename=@filename+'\'
set @m_tbname='declare #tb cursor for select name from '+@tbname+'..sysobjects where xtype=''U'''
exec(@m_tbname)
open #tb
fetch next from #tb into @m_tbname
while @@fetch_status=0
begin
set @sql='bcp '+@tbname+'..'+@m_tbname
+case when @isout=1 then ' out ' else ' in ' end
+' "'+@filename+@m_tbname+'.txt " /w'
+' /S '+@servername
+case when isnull(@username,'')='' then '' else ' /U '+@username end
+' /P '+isnull(@password,'')
exec master..xp_cmdshell @sql
fetch next from #tb into @m_tbname
end
close #tb
deallocate #tb
end
go
精简checkbox全选代码
-----------------------------------
This page contains sample ADO connection strings for ODBC DSN / DSN-Less,
OLE DB Providers, Remote Data Services (RDS), MS Remote, MS DataShape.
Also included are ADO.NET connection strings for each .NET Managed Provider
(SQLClient, OLEDB, and ODBC).
These sample connection strings are compiled
by Carl Prothman, a Microsoft Visual Basic MVP
Enjoy!
Table of Contents
ODBC DSN Connections DSN
File DSN
ODBC DSN-Less Connections ODBC Driver for AS/400
ODBC Driver for Access
ODBC Driver for dBASE
ODBC Driver for Excel
ODBC Driver for MySQL
ODBC Driver for Oracle
ODBC Driver for Paradox
ODBC Driver for SQL Server
ODBC Driver for Sybase
ODBC Driver for Sybase SQL Anywhere
ODBC Driver for Text
ODBC Driver for Teradata
ODBC Driver for Visual FoxPro
OLE DB Data Link Connections Data Link File (UDL)
OLE DB Data Provider Connections OLE DB Provider for AS/400
OLE DB Provider for Active Directory Service
OLE DB Provider for DB2
OLD DB Provider for Internet Publishing
OLE DB Provider for Index Server
OLE DB Provider for Microsoft Jet
OLE DB Provider for ODBC Databases
OLE DB Provider for Oracle (From Microsoft)
OLE DB Provider for Oracle (From Oracle)
OLE DB Provider for Simple Provider
OLE DB Provider for SQL Server
Remote Data Service (RDS) Connections RDS Data Control - Connect Property
RDS Data Control - URL Property
ADO URL Connections ADO Recordset
MS Remote Provider Connections MS Remote - Access (Jet)
MS Remote - SQL Server
Data Shape Provider Connections MS DataShape - SQL Server
.NET Managed Provider Connections SQL Client .NET Managed Provider (System.Data.SqlClient)
OLE DB .NET Managed Provider (System.Data.OleDb)
ODBC .NET Managed Provider (System.Data.ODBC)
ODBC DSN Connections
Using an ODBC DSN (Data Source Name) is a two step process.
1) You must first create the DSN via the "ODBC Data Source Administrator" program
found in your computer's Control Panel (or Administrative Tools menu in Windows 2000).
Make sure to create a SYSTEM DSN (not a USER DSN) when using ASP.
Note: You can also create the DSN via VB code.
2) Then use the following connection string - with your own DSN name of course. ;-)
ODBC - DSN
oConn.Open "DSN=AdvWorks;" & _
"Uid=Admin;" & _
"Pwd=;
You can also create and use a File DSN. Then use the following ADO Connection string:
ODBC - File DSN
oConn.Open "FILEDSN=c:\somepath\mydb.dsn;" & _
"Uid=Admin;" & _
"Pwd=;"
For more information, see: About ODBC data sources and
How to Use File DSNs and DSN-less Connections
Note: The problem with DSN is that Users can (and will) modify them (or delete by mistake),
then your program won't work so well... So it's better to use a DSN-Less or OLE DB Provider
connection string with a Trusted Connection if possible!
ODBC DSN-Less Connections
ODBC Driver for AS/400
oConn.Open "Driver={Client Access ODBC Driver (32-bit)};" & _
"System=myAS400;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
For more information, see: A Fast Path to AS/400 Client/Server
ODBC Driver for Access
For Standard Security:
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=c:\somepath\mydb.mdb;" & _
"Uid=Admin;" & _
"Pwd=;"
If you are using a Workgroup (System database):
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=c:\somepath\mydb.mdb;" & _
"SystemDB=c:\somepath\mydb.mdw;", _
"admin", ""
If MDB is located on a network share:
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=\\myServer\myShare\myPath\myDb.mdb;"
For more information, see: Microsoft Access Driver Programming Considerations
ODBC Driver for dBASE
oConn.Open "Driver={Microsoft dBASE Driver (*.dbf)};" & _
"DriverID=277;" & _
"Dbq=c:\somepath;"
Note: Specify the filename in the SQL statement. For example:
oRs.Open "Select * From user.dbf", oConn, , ,adCmdText
Note: MDAC 2.1 (or greater) requires the Borland Database Engine (BDE) to update dBase DBF files. (Q238431).
For more information, see: dBASE Driver Programming Considerations
ODBC Driver for Excel
oConn.Open "Driver={Microsoft Excel Driver (*.xls)};" & _
"DriverId=790;" & _
"Dbq=c:\somepath\mySpreadsheet.xls;" & _
"DefaultDir=c:\somepath;"
For more information, see: Microsoft Excel Driver Programming Considerations
ODBC Driver for MySQL (via MyODBC)
To connect to a local database
oConn.Open "Driver={mySQL};" & _
"Server=MyServerName;" & _
"Option=16834;" & _
"Database=mydb;"
To connect to a remote database
oConn.Open "Driver={mySQL};" & _
"Server=db1.database.com;" & _
"Port=3306;" & _
"Option=131072;" & _
"Stmt=;" & _
"Database=mydb;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
For more information, see: Programs Known to Work with MyODBC
ODBC Driver for Oracle
For the current Oracle ODBC Driver from Microsoft:
oConn.Open "Driver={Microsoft ODBC for Oracle};" & _
"Server=OracleServer.world;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
For the older Oracle ODBC Driver from Microsoft:
oConn.Open "Driver={Microsoft ODBC Driver for Oracle};" & _
"ConnectString=OracleServer.world;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
For more information, see: Connection String Format and Attributes
ODBC Driver for Paradox
oConn.Open "Driver={Microsoft Paradox Driver (*.db)};" & _
"DriverID=538;" & _
"Fil=Paradox 5.X;" & _
"DefaultDir=c:\dbpath\;" & _
"Dbq=c:\dbpath\;" & _
"CollatingSequence=ASCII;"
Note: MDAC 2.1 (or greater) requires the Borland Database Engine (BDE) to update Paradox ISAM fDBF files. (Q230126).
For more information, see: Paradox Driver Programming Considerations
ODBC Driver for SQL Server
For Standard Security:
oConn.Open "Driver={SQL Server};" & _
"Server=MyServerName;" & _
"Database=myDatabaseName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
For Trusted Connection security:
oConn.Open "Driver={SQL Server};" & _
"Server=MyServerName;" & _
"Database=myDatabaseName;" & _
"Uid=;" & _
"Pwd=;"
' or
oConn.Open "Driver={SQL Server};" & _
"Server=MyServerName;" & _
"Database=myDatabaseName;" & _
"Trusted_Connection=yes;"
To Prompt user for username and password
oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Driver={SQL Server};" & _
"Server=MyServerName;" & _
"DataBase=myDatabaseName;"
For more information, see: SQLDriverConnect (ODBC)
ODBC Driver for Sybase
If using the Sybase System 11 ODBC Driver:
oConn.Open "Driver={SYBASE SYSTEM 11};" & _
"Srvr=myServerName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
If using the Intersolv 3.10 Sybase ODBC Driver:
oConn.Open "Driver={INTERSOLV 3.10 32-BIT Sybase};" & _
"Srvr=myServerName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
For more information, see: Sybase System 10 ODBC Driver Reference Guide
ODBC Driver for Sybase SQL Anywhere
oConn.Open "ODBC; Driver=Sybase SQL Anywhere 5.0;" & _
"DefaultDir=c:\dbpath\;" & _
"Dbf=c:\sqlany50\mydb.db;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
"Dsn="""";"
Note: Including the DSN tag with a null string is absolutely critical or else you get the dreaded -7778 error.
For more information, see: Sybase SQL Anywhere User Guide
ODBC Driver for Teradata
oConn.Open "Provider=Teradata;" & _
"DBCName=MyDbcName;" & _
"Database=MyDatabaseName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
For more information, see Teradata ODBC Driver
ODBC Driver for Text
oConn.Open "Driver={Microsoft Text Driver (*.txt; *.csv)};" & _
"Dbq=c:\somepath\;" & _
"Extensions=asc,csv,tab,txt;" & _
"Persist Security Info=False"
Note: Specify the filename in the SQL statement. For example:
oRs.Open "Select * From customer.csv", _
oConn, adOpenStatic, adLockReadOnly, adCmdText
For more information, see: Text File Driver Programming Considerations
'=================================================
'函数名:JoinChar
'作 用:自动判断链接地址并向地址中加入 ? 或 &
'参 数:strUrl ----网址
'返回值:加了 ? 或 & 的网址
'=================================================
function JoinChar(strUrl)
if strUrl="" then
JoinChar=""
exit function
end if
if InStr(strUrl,"?")
if InStr(strUrl,"&")
else
JoinChar=strUrl
end if
else
JoinChar=strUrl & "?"
end if
else
JoinChar=strUrl
end if
end function
ODBC Driver for Visual FoxPro
With a database container:
oConn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBC;" & _
"SourceDB=c:\somepath\mySourceDb.dbc;" & _
"Exclusive=No;"
Without a database container (Free Table Directory):
oConn.Open "Driver={Microsoft Visual FoxPro Driver};" & _
"SourceType=DBF;" & _
"SourceDB=c:\somepath\mySourceDbFolder;" & _
"Exclusive=No;"
For more information, see: Visual FoxPro ODBC Driver and Q165492
OLE DB Data Link Connections
Data Link File (UDL)
For Absolute Path:
oConn.Open "File Name=c:\somepath\myDatabaseName.udl;"
For Relative Path:
oConn.Open "File Name=myDatabaseName.udl;"
For more information, see: HOWTO: Use Data Link Files with ADO
Note: Windows 2000 no longer contains the "New | Microsoft Data Link" menu
anymore. You can add the Data Link menu back in the menu list by running the
"C:\Program Files\Common Files\System\Ole DB\newudl.reg" reg file,
then right-click on the desktop and select "New | Microsoft Data Link" menu.
Or you can also create a Data Link file by creating a text file and change it's
file extension to ".udl", then double-click the file.
OLE DB Provider Connections
OLE DB Provider for AS/400
oConn.Open "Provider=IBMDA400;" & _
"Data source=myAS400;"
"User Id=myUsername;" & _
"Password=myPassword;"
For more information, see: A Fast Path to AS/400 Client/Server
OLE DB Provider for Active Directory Service
oConn.Open "Provider=ADSDSOObject;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
For more information, see: Microsoft OLE DB Provider for Microsoft Active Directory Service
OLE DB Provider for DB2
oConn.Open = "Provider=DB2OLEDB;" &
"Network Transport Library=TCPIP;" &
"Network Address=MyServer;" & _
"Package Collection=MyPackage;" &
"Host CCSID=1142"
"Initial Catalog=MyDB;" &
"User ID=MyUsername;" & _
"Password=MyPassword;"
For more information, see: OLE DB Provider for DB2
and INF: Configuring Data Sources for the Microsoft OLE DB Provider for DB2
OLE DB Provider for Index Server
oConn.Open "Provider=msidxs;" & _
"Data source=MyCatalog;"
For more information, see: Microsoft OLE DB Provider for Microsoft Indexing Service
OLE DB Provider for Internet Publishing
oConn.Open "Provider=MSDAIPP.DSO;" & _
"Data Source=http://mywebsite/myDir;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
For more information, see: Microsoft OLE DB Provider for Internet Publishing and Q245359
OLE DB Provider for Microsoft Jet
For standard security:
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\myDb.mdb;" & _
"User Id=admin;" & _
"Password=;"
If using a Workgroup (System Database):
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;" & _
"Jet OLEDB:System Database=MySystem.mdw;", _
"admin", ""
Note, remember to convert both the MDB and the MDW to the 4.0 database format when using the 4.0 OLE DB Provider.
If MDB has a database password:
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;" & _
"Jet OLEDBatabase Password=MyDbPassword;", _
"admin", ""
If MDB is located on a network share:
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=\\myServer\myShare\myPath\myDb.mdb;
If want to open up the Access database exclusively:
oConn.Mode = adModeShareExclusive
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\myDb.mdb;" & _
"User Id=admin;" & _
"Password=;"
For more information, see: OLE DB Provider for Microsoft Jet, Q191754, Q225048, Q239114, and Q271908
You can also open an Excel Spreadsheet using the "OLE DB Provider for Microsoft Jet"
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\myExcelSpreadsheet.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes;"";"
Where "HDR=Yes" means that there is a header row in the cell range
(or named range), so the provider will not include the first row of the
selection into the recordset. If "HDR=No", then the provider will include
the first row of the cell range (or named ranged) into the recordset.
For more information, see: Q278973
You can also open a Text File using the "OLE DB Provider for Microsoft Jet"
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\;" & _
"Extended Properties=""text;HDR=Yes;FMT=Delimited;"";"
' Then open a recordset based on a select on the actual file
oRs.Open "Select * From MyTextFile.txt", oConn, adOpenStatic, adLockReadOnly, adCmdText
For more information, see: Q262537
OLE DB Provider for ODBC Databases
For Access (Jet):
oConn.Open "Provider=MSDASQL;" & _
"Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=c:\somepath\mydb.mdb;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
For SQL Server:
oConn.Open "Provider=MSDASQL;" & _
"Driver={SQL Server};" & _
"Server=myServerName;" & _
"Database=myDatabaseName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
For more information, see: Microsoft OLE DB Provider for ODBC
OLE DB Provider for Oracle (from Microsoft)
oConn.Open "Provider=msdaora;" & _
"Data Source=MyOracleDB;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
For more information, see: Microsoft OLE DB Provider for Oracle
OLE DB Provider for Oracle (from Oracle)
For Standard Security:
oConn.Open "Provider=OraOLEDB.Oracle;" & _
"Data Source=MyOracleDB;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
For a Trusted Connection:
oConn.Open "Provider=OraOLEDB.Oracle;" & _
"Data Source=MyOracleDB;" & _
"User Id=/;" & _
"Password=;"
' Or
oConn.Open "Provider=OraOLEDB.Oracle;" & _
"Data Source=MyOracleDB;" & _
"OSAuthent=1;"
Note: "Data Source=" must be set to the appropriate Net8 name which is known to the naming method in use. For example, for Local Naming, it is the alias in the tnsnames.ora file; for Oracle Names, it is the Net8 Service Name.
For more information, see: Connecting to an Oracle Database
(Note, if you get a Logon dialog, then click Cancel, then perform a one-time free signup with Oracle's TechNet system)
OLE DB Provider for Simple Provider
The Microsoft OLE DB Simple Provider (OSP) allows ADO to access any data for which a provider has
been written using the OLE DB Simple Provider Toolkit. Simple providers are intended to access data
sources that require only fundamental OLE DB support, such as in-memory arrays or XML documents.
OSP in MDAC 2.6 has been enhanced to support opening hierarchical ADO Recordsets over arbitrary
XML files. These XML files may contain the ADO XML persistence schema, but it is not required. This
has been implemented by connecting the OSP to the MSXML2.DLL, therefore MSXML2.DLL or newer is
required.
oConn.Open "Provider=MSDAOSP;" & _
"Data Source=MSXML2.DSOControl.2.6;"
oRS.Open "http://WebServer/VirtualRoot/MyXMLFile.xml", oConn
For more information, see: Microsoft OLE DB Simple Provider
OLE DB Provider for SQL Server
For Standard Security:
oConn.Open "Provider=sqloledb;" & _
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
For a Trusted Connection:
oConn.Open "Provider=sqloledb;" & _
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"Integrated Security=SSPI;"
To connect to a "Named Instance" (SQL Server 2000)
oConn.Open "Provider=sqloledb;" & _
"Data Source=myServerName\Inst2;" & _
"Initial Catalog=myDatabaseName;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
To Prompt user for username and password:
oConn.Provider = "sqloledb"
oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;"
To connect via an IP address:
oConn.Open "Provider=sqloledb;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Network Library=DBMSSOCN;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword;"
Note:
- xxx.xxx.xxx.xxx is an IP address
- "Network Library=DBMSSOCN" tells OLE DB to use TCP/IP rather than Named Pipes (Q238949)
- 1433 is the default port number for SQL Server
- You can also add "Encrypt=yes" for encryption
For more information, see: Microsoft OLE DB Provider for SQL Server
Remote Data Service (RDS) Connections
The following examples show how to connect to a remote database using the RDS Data Control.
When using the RDS DataControl's Server/SQL/Connect properties, the RDS DataControl uses the
RDS DataFactory on the remote server. If you use the RDS DataControl's URL property,
then the RDS DataFactory is not used at all.
WARNING: The RDS DataFactory can be a major security hole if not setup and configured correctly!
For more information, see RDS FAQ #24
RDS DataControl - Connect Property
With the RDS default handler disabled (not recommend due to security risks):
With oRdc
.Server = "http://carl2"
.Sql = "Select * From Authors Where State = 'CA'"
.Connect = "Provider=sqloledb;" & _
"Data Source=(local);" & _
"Initial Catalog=pubs;" & _
"User Id=sa;" & _
"Password=;"
.Refresh
End With
With the RDS default handler enabled (recommend):
With oRdc
.Server = "http://carl2"
.Handler = "MSDFMAP.Handler"
.Connect = "Data Source=MyConnectTag;"
.Sql = "MySQLTag(""CA"")"
.Refresh
End With
The corresponding CONNECT and SQL sections in the default handler \WINNT\MSDFMAP.INI file would be:
[connect MyConnectTag]
Access = ReadWrite
Connect = "Provider=sqloledb;Data Source=(local);Initial Catalog=pubs;User Id=saassword=;"
[sql MySQLTag]
Sql = "Select * From Authors Where State = '?'"
For more information about the RDS Default Handler, see:
Q243245, Q230680, and RDS Customization Handler Microsoft articles
RDS DataControl - URL Property
To get records from a remote database:
With oRdc
.URL = "http://carlp0/Authors_GetByState.asp?state=CA"
.Refresh
End With
To save, set the URL property to an ASP web page:
With oRdc
.URL = "http://carlp0/rdsdatacontrol/Authors_Save.asp"
.SubmitChanges
End With
For more information, see: RDS URL Property
ADO URL Connections
ADO 2.5+ allows you to open up a Recordset based on XML returned from an ASP file over HTTP.
This feature doesn't use RDS at all.
ADO Recordset
To get records from a remote database:
oRs.Open "http://carlp0/Authors_GetByState.asp?state=CA", , _
adOpenStatic, adLockBatchOptimistic
To save changes, you must use the MSXML's XMLHTTP object to POST back the updated XML.
The Recordset's Update and UpdateBatch methods will not work in this case.
' Save Recordset into Stream
Set oStm = New ADODB.Stream
oRs.Save oStm, adPersistXML
' Use MSXML's XMLHTTP object to open ASP and post a XML stream
Set oXMLHTTP = New MSXML2.XMLHTTP30
oXMLHTTP.Open "POST", "http://carlp0/Authors_Save.asp", False
oXMLHTTP.Send oStm.ReadText
' If an error occurred
If oXMLHTTP.Status = 500 Then
Debug.Print oXMLHTTP.statusText
End If
For more information, see: ADO Recordset's Open Method
MS Remote Provider Connections
The following connections strings use Microsoft's remote provider (MS Remote). The MS Remote
provider tells ADO to communicate with the remote server (via the RDS DataFactory) and to use
the remote provider that is installed on the remote server.
WARNING: The RDS DataFactory can be a major security hole if not setup and configured correctly!
For more information, see RDS FAQ #24
MS Remote - Access (Jet)
If you want to use an ODBC DSN on the remote machine:
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Remote Provider=MSDASQL;" & _
"DSN=AdvWorks;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
If you want to use an OLE DB Provider on the remote machine:
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;", _
"admin", ""
If you want to use an OLE DB Provider on the remote machine (via RDS DataFactory Default Handler):
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Handler=MSDFMAP.Handler;" & _
"Data Source=MyAdvworksConn;"
The corresponding entry in the \winnt\Msdfmap.ini file would be:
[connect MyAdvworksConn]
Access = ReadWrite
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=mydb.mdb;" & _
"User Id=admin;" & _
"Password=;"
MS Remote - SQL Server
If you want to use an ODBC DSN on the remote machine:
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Remote Provider=MSDASQL;" & _
"DSN=myDatabaseName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
If you want to use an OLE DB Provider on the remote machine:
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Remote Provider=SQLOLEDB;" & _
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword;"
If you want to use an OLE DB Provider on the remote machine (via RDS DataFactory Default Handler):
oConn.Open "Provider=MS Remote;" & _
"Remote Server=http://myServerName;" & _
"Handler=MSDFMAP.Handler;" & _
"Data Source=MyPubsConn;"
The corresponding entry in the \winnt\Msdfmap.ini file would be:
[connect MyPubsConn]
Access = ReadWrite
Connect = "Provider=SQLOLEDB;" & _
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Password=myPassword;"
For more information, see: Microsoft OLE DB Remoting Provider and Q240838
Data Shape Provider Connections
MS DataShape - SQL Server
oConn.Open "Provider=MSDataShape;" & _
"Data Provider=SQLOLEDB;" & _
"Data Source=mySQLServerName;" & _
"Initial Catalog=myDatabase;" & _
"User ID=myUsername;" & _
"Password=myPassword;"
Then use a Shape command with SQL strings:
sSQL = "SHAPE {select * from authors} " & _
"APPEND ({select * from titleauthor} AS chapter " & _
"RELATE au_id TO au_id)"
Or use a Shape command that calls Stored Procedures:
sSQL = "SHAPE {exec spAuthors_LoadAll} " & _
"APPEND ({exec spTitleAuthor_LoadAll} AS chapter " & _
"RELATE au_id TO au_id)"
For more information, see: Microsoft Data Shaping Service for OLE DB and Q288409
.NET Managed Provider Connections
SQL Client .NET Managed Provider (System.Data.SqlClient)
The SQL Client .NET Managed Provide allows you to connect to a Microsoft SQL Server 7.0
or 2000 database. For Microsoft SQL Server 6.0 or earlier, use the OLE DB .NET Data Provider
with the "SQL Server OLE DB Provider" (SQLOLEDB).
Dim oSQLConnection As SqlClient.SqlConnection
Dim sConnString As String
sConnString = "Data Source=(local);" & _
"Initial Catalog=NorthWind;" & _
"Integrated Security=SSPI;" & _
"Pooling=True;" & _
"Min Pool Size=10;" & _
"Max Pool Size=50;" & _
"Connection Lifetime=30;" & _
"Connection Reset=True;" & _
"Enlist=True;"
oSQLConnection = New SqlClient.SqlConnection(sConnString)
oSQLConnection.Open()
For more information, see: System.Data.SQL Namespace and .NET Data Providers
Note: 'SQL' namespace got renamed to 'SQLClient'
OLE DB .NET Managed Provider (System.Data.OleDb)
The OLE DB .NET Data Provider uses native OLE DB through COM interop to enable data access.
To use the OLE DB .NET Data Provider, you must also use an OLE DB provider (e.g. SQLOLEDB,
MSDAORA, or Microsoft.JET.OLEDB.4.0).
For SQL Server OLE DB Provider (for SQL Server 6.0 or earlier)
Dim oOleDbConnection As OleDb.OleDbConnection
Dim sConnString As String
sConnString = "Provider=sqloledb;" & _
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"User Id=myUsername;" & _
"Password=myPassword;"
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()
For JET OLE DB Provider:
Dim oOleDbConnection As OleDb.OleDbConnection
Dim sConnString As String
sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Work\nwind.mdb;" & _
"User ID=Admin;" & _
"Password="";"
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()
For more information, see: System.Data.OleDb Namespace and .NET Data Providers
Note: 'ADO' namespace got renamed to 'OleDb'
ODBC .NET Managed Provider (System.Data.ODBC)
The ODBC .NET Data Provider is an add-on component to the .NET Framework SDK Beta 2.
It provides access to native ODBC drivers the same way the OLE DB .NET Data Provider
provides access to native OLE DB providers.
For SQL Server ODBC Driver:
Dim oODBCConnection As Odbc.OdbcConnection
Dim sConnString As String
' Create and open a new ODBC Connection
sConnString = "Driver={SQL Server};" & _
"Server=MySQLServerName;" & _
"Database=MyDatabaseName;" & _
"Uid=MyUsername;" & _
"Pwd=MyPassword;"
oODBCConnection = New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()
For Oracle ODBC Driver:
Dim oODBCConnection As Odbc.OdbcConnection
Dim sConnString As String
' Create and open a new ODBC Connection
sConnString = "Driver={Microsoft ODBC for Oracle};" & _
"Server=OracleServer.world;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
oODBCConnection = New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()
For Access (JET) ODBC Driver:
Dim oODBCConnection As Odbc.OdbcConnection
Dim sConnString As String
' Create and open a new ODBC Connection
sConnString = "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=c:\somepath\mydb.mdb;" & _
"Uid=Admin;" & _
"Pwd=;"
oODBCConnection = New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()
For all other ODBC Drivers:
Dim oODBCConnection As Odbc.OdbcConnection
Dim sConnString As String
' Create and open a new ODBC Connection
sConnString = "Dsn=myDsn;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
oODBCConnection = New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()
|手机版|心飞设计-版权所有:微度网络信息技术服务中心 ( 鲁ICP备17032091号-12 )|网站地图
GMT+8, 2024-12-26 11:41 , Processed in 0.411763 second(s), 25 queries .
Powered by Discuz! X3.5
© 2001-2024 Discuz! Team.