急!DW做的网站本地测试成功,传到虚拟服务器上链接不到数据库!
代码是:<%@LANGUAGE="JAVASCRIPT"%><!--#includefile="Connections/sdy.asp"--><%varjiuyexinx...
代码是:
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="Connections/sdy.asp" -->
<%
var jiuyexinxi = Server.CreateObject("ADODB.Recordset");
jiuyexinxi.ActiveConnection = MM_sdy_STRING;
jiuyexinxi.Source = "SELECT * FROM zhaopinxinxi ORDER BY ID DESC";
jiuyexinxi.CursorType = 0;
jiuyexinxi.CursorLocation = 2;
jiuyexinxi.LockType = 1;
jiuyexinxi.Open();
var jiuyexinxi_numRows = 0;
%>
file="Connections/sdy.asp"的代码是:
<%
// FileName="Connection_odbc_conn_dsn.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="false"
// Catalog=""
// Schema=""
var MM_sdy_STRING = "dsn=sdy;"
%> 展开
<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="Connections/sdy.asp" -->
<%
var jiuyexinxi = Server.CreateObject("ADODB.Recordset");
jiuyexinxi.ActiveConnection = MM_sdy_STRING;
jiuyexinxi.Source = "SELECT * FROM zhaopinxinxi ORDER BY ID DESC";
jiuyexinxi.CursorType = 0;
jiuyexinxi.CursorLocation = 2;
jiuyexinxi.LockType = 1;
jiuyexinxi.Open();
var jiuyexinxi_numRows = 0;
%>
file="Connections/sdy.asp"的代码是:
<%
// FileName="Connection_odbc_conn_dsn.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="false"
// Catalog=""
// Schema=""
var MM_sdy_STRING = "dsn=sdy;"
%> 展开
2个回答
展开全部
你用的是不是先在本加添加数据源,再用DW里的“数据源名称”来连接数据库的?那样的话就会出问题。要用自定义连接字符串的,代码如下:
Quotation
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;
Quotation
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;
参考资料: http://www.dl2008.cn/post/106/
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询