标题:这个提示连接不上,是参数有问题,怎么改呀,帮帮忙。(AC数据库)
只看楼主
天空天空
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2008-12-2
 问题点数:0 回复次数:0 
这个提示连接不上,是参数有问题,怎么改呀,帮帮忙。(AC数据库)
<%@ LANGUAGE = VBScript CodePage = 936%>
<%
Option Explicit
Dim startime,Conn,db
Response.Buffer = True
startime = Timer()
'--定义数据库类别,1为SQL数据库,0为Access数据库
Const isSqlDataBase = 0
Dim NowString
Dim ConnStr

If IsSqlDataBase = 1 Then
    '-----------------------SQL数据库连接参数---------------------------------------
    Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
    NowString = "GetDate()"
    SqlDatabaseName = "jiusui"     '数据库名
    SqlUsername = "sa"          '用户名
    SqlPassword = ""          '用户密码
    SqlLocalName = "(local)"        '连接名(本地用local,外地用IP)
    ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
    '-------------------------------------------------------------------------------
Else
    '-----------------------ACCESS数据库连接----------------------------------------
    NowString = "Now()"
    'ACCESS数据库连接,请使用根路径或者绝对路径
    db = "\database\database.mdb"
    Connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & ChkMapPath(db)
    '-------------------------------------------------------------------------------
End If

Dim DBPath
'-- 采集数据库连接路径
DBPath = "/database/#Collection.asa"        '-- 请用根相对路径

Sub ConnectionDatabase()
    On Error Resume Next
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open Connstr
    If Err Then
        Err.Clear
        Set Conn = Nothing
        Response.Write "数据库连接出错,请打开conn.asp文件检查连接字串。"
        Response.End
    End If
End Sub
Sub CloseConn()
    Set Newasp = Nothing
End Sub
%>
搜索更多相关主题的帖子: 参数 提示 
2008-12-02 22:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-247466-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.086870 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved