当前位置:编程学习 > asp >>

ASP的Internet/Intranet编程常见问题

基于ASP技术开发Internet/Intranet上的MIS系统是非常方便的,首先是它借用了ADO技术和概念,同时通过ODBC访问数据库,达到了充分的灵活性和多平台性,另外,由于ASP利用VBS和JS脚本语言,也保证大多数开发者很快进入开发过程,减少了学习的过程。
  但是,由于ASP是基于Internet/Intranet方式的,它和传统的C/S结构毕竟有所不同,这样在开发中也要注意一些细节问题。本文讲述常见的一些问题,并给出解决方法。
问题描述
A. 无法正确运行ASP
  当我们建立了一个ASP文件,并且符合语法时,通过浏览器输入以下地址,或通过资源管理器打开浏览:
c:inetpubwwwroota.asp
将出现无法运行的错误,并提示权限不对或文件无法访问,原因是,ASP文件首先要求站点是具备“执行(脚本)”属性的;然后要求按照URL格式输入地址,而不是DOS格式,所以,请改正这两个错误。
B. 程序移动位置后,无法访问数据库
  这种错误首先在ODBC,如果ODBC数据源设置正确,那么需要注意ASP中打开数据库的命令:Conn.Open 的参数是否正确。如果正确,则需要注意是否使用了global.asa文件,该文件是ASP连接数据库的配置文件,该文件内容如下:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
'You can add special event handlers in this file that will get run automatically when special Active Server Pages events
'occur. To create these handlers, just create a subroutine with a name from the list below that corresponds to the event
'you want to use. For example, to create an event handler for Session_OnStart, you would put the following code into this
'file (without the comments):
'EventName Description
'Session_OnStart Runs the first time a user runs any page in your application
'Session_OnEnd Runs when a user's session times out or quits your application
'Application_OnStart Runs once when the first page of your application is run for the first time by any user
'Application_OnEnd Runs once when the web server shuts down
</SCRIPT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnStart
'==Visual InterDev Generated - DataConnection startspan==
补充:asp教程,XML相关 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,