在连接字符串里加上服务器和数据库驱动程序就可以了 Example: dim conn set conn = Server.CreateObject("ADODB.Connection") conn.ConnectionString = "driver={SQL Server};"server=yourserver;uid=sa;pwd=pwd;database=pubs" conn.open Set cmd= Server.CreateObject("ADODB.Command") Set cmd.ActiveConnection = conn
<% ' BEGIN USER CONSTANTS ' To just use a DSN, the format is shown on the next line: 'Const DSN_NAME = "DSN=ASP101email" ' Two other samples I used it with. Left in as syntax examples for DSN-less connections 'Const DSN_NAME = "DBQ=C:\InetPub\wwwroot\asp101\samples\database.mdb;Driver={Microsoft Acces...