主题:  ASP的数据库链接!!!!!!!

fancyren

职务:普通成员
等级:1
金币:0.0
发贴:100
注册:2002/5/21 21:02:58
#12002/8/17 13:08:34
我用UD生成的ASP的数据库链接页面代码如下:(在Connections/fldt.asp)
%
' FileName="Connection_odbc_conn_dsn.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_fldt_STRING
MM_fldt_STRING = "dsn=fldt;"
%>


feedback.asp页面:

<%@LANGUAGE="VBSCRIPT"%>

<%
set gb = Server.CreateObject("ADODB.Recordset")
gb.ActiveConnection = MM_fldt_STRING
gb.Source = "SELECT * FROM guestbook ORDER BY gsj DESC"
gb.CursorType = 0
gb.CursorLocation = 2
gb.LockType = 3
gb.Open()
gb_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 12
Dim Repeat1__index
Repeat1__index = 0
gb_numRows = gb_numRows + Repeat1__numRows
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next

' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>

在本机是可以调用,正常显示,可是传到网上提示,HTTP 500 - 内部服务器错误 !

这是什么原因,请高手帮我改改!!!!

多谢!!!!



测试

职务:普通成员
等级:1
金币:0.0
发贴:116
注册:2002/8/7 14:39:54
#22002/8/17 21:04:12
数据库连接错误,



fancyren

职务:普通成员
等级:1
金币:0.0
发贴:100
注册:2002/5/21 21:02:58
#32002/8/18 8:26:43
我知道呀,怎么错!!!



测试

职务:普通成员
等级:1
金币:0.0
发贴:116
注册:2002/8/7 14:39:54
#42002/8/18 12:35:11
MM_fldt_STRING = "dsn=fldt;"改一下MM_fldt_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath( "/你的目录/你的数据库.mdb(asa或asp)")

编辑历史:[这消息被测试编辑过(编辑时间2002-08-18 12:36:08)]