怎样在dreamweaver中编写自定义连接字符串,使asp网页和access数据库连接

能让网页上传到虚拟主机上正常显示
2024-12-21 13:17:34
推荐回答(2个)
回答1:

jsp+mysql
<%
// FileName="mysql_jdbc_conn.htm"
// Type="JDBC" ""
// DesigntimeType="JDBC"
// HTTP="true"
// Catalog=""
// Schema=""
String MM_intershopcon_DRIVER = "org.gjt.mm.mysql.Driver";
String MM_intershopcon_USERNAME = "数据库用户";
String MM_intershopcon_PASSWORD = "密码";
String MM_intershopcon_STRING = "jdbc:mysql://localhost/intershop?useUnicode=true&characterEncoding=gbk";
%>

asp+access

<%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_guest_link_STRING
MM_guest_link_STRING = "dsn=guest_data;"
%>

回答2:

ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath("数据库路径")
On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr