| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 713 人关注过本帖
标题:请高手解决这个连接不上SQL SERVER 2000的问题,困惑我很长时间了
只看楼主 加入收藏
qinglian2008
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-8-1
收藏
 问题点数:0 回复次数:0 
请高手解决这个连接不上SQL SERVER 2000的问题,困惑我很长时间了
三个文件:
1.oa.reg 确信以下帐户和密码正确

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Kingcome\KCOA]
"DBServerName"="(local)"
"DatabaseName"="LKOA"
"UserName"="sa"
"PassWord"="111111"
"TempPath"="D:\\_tohaiyan\\kcoa\\AtthTemp"
"INSTALLPATH"="D:\\_tohaiyan\\kcoa"
"Version"="V2.1"
"DBPath"="D:\\_tohaiyan\\kcoa\\DB"
"LKOADIR"="D:\\_tohaiyan\\kcoa"

2.global.asa
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<SCRIPT LANGUAGE=VBScript RUNAT="Server">
Sub Application_Onstart
    dim sServer,sUser,sDBName,sPass,sTmpPath,sInstallPath,sVersion
    Dim WshShell
    set WshShell=Server.CreateObject("WScript.Shell")
    sserver=WshShell.RegRead("HKLM\SOFTWARE\Kingcome\KCOA\DBServerName")
    sDBName=WshShell.RegRead("HKLM\SOFTWARE\Kingcome\KCOA\DatabaseName")
    sUser=WshShell.RegRead("HKLM\SOFTWARE\Kingcome\KCOA\UserName")
    sPass=WshShell.RegRead("HKLM\SOFTWARE\Kingcome\KCOA\PassWord")
    sTmpPath=WshShell.RegRead("HKLM\SOFTWARE\Kingcome\KCOA\TempPath")
    sInstallPath=WshShell.RegRead("HKLM\SOFTWARE\Kingcome\KCOA\INSTALLPATH")
    sVersion=WshShell.RegRead("HKLM\SOFTWARE\Kingcome\KCOA\Version")
    if right(sInstallPath,1)="\" then sInstallPath = mid(sInstallPath,1,len(sInstallPath)-1)
    set WshShell = nothing
    if sserver&"" = "" then    sserver="127.0.0.1"
    Application("ConnectString") = _
                "Provider=SQLOLEDB.1;" _
                & "Password=" & sPass & ";" _
                & "Persist Security Info=True;" _
                & "User ID=" & sUser & ";" _
                & "Initial Catalog=" & sDBName & ";" _
                & "Data Source=" & sServer & ";" _
                & "Connect Timeout=15"
    Application("RecPerPage")    =    15
    Application.Lock
    Application("whoson")=0
    Application.UnLock
    Application("Pub_Gs_ShowStr")    = "公司"
    Application("Pub_Bm_ShowStr")    = "部门"
    Application("Pub_Yg_ShowStr")    = "员工"
    Application("TempPath")    = sTmpPath
    Application("LKOAPath")    = sInstallPath
    Application("LKOAVersion") = sVersion
End sub

Sub Session_Onstart
    Session("uID")=""
    Session("uDeptID")=""
    Session("uName")=""
    Session("uNC")=""
    Session("uDeptName")=""
    Session("uYGBH")=""
    Session("uKL")=""
    Session("bbs_userName")=""
    Session("bbs_userID")=""
    Session("bbs_Dl") = ""
    'session.Timeout=20
End sub

sub session_onend
application.Lock
application("whoson")=application("whoson")-1
if application("whoson")< 1 then
    application("whoson") = 0
end if
application.UnLock
end sub
</SCRIPT>
3.connect.asp  为什么无法连接数据库
<% Response.Buffer = True %>
<%
Dim Conn
    on error resume next
    Set Conn=server.CreateObject("ADODB.CONNECTION")    
     conn.open Application("ConnectString")
    if Err<>0 then
    %>
        <script language="vbscript">
            msgbox "无法连接数据库!",vbCritical,"错误"
        </script>
    <%    
        Response.End
    end if
%>
搜索更多相关主题的帖子: SQL SERVER 困惑 时间 
2008-08-01 08:22
快速回复:请高手解决这个连接不上SQL SERVER 2000的问题,困惑我很长时间了
数据加载中...
 
   



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

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