主题:  为什么我总是出现ASP和ODBC错误

万木春

职务:普通成员
等级:1
金币:0.0
发贴:165
注册:2002/6/17 21:30:27
#12002/7/22 21:57:25
我用UD做调查表单的填写,在插入SERVER BEHAVIORS的INSERT RECORD后开始执行总是出现ASP内部错误,试图访问的网页出现问题,无法显示。Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
/site/free/TMP53zhnznlaq.asp, 第 88 行
重做数据库依然如此,我是用第三种方法做的,测试是成功的,我把代码上传上来请各位指点问题出在IE还是IIS,或ODBC?
<%@LANGUAGE="VBSCRIPT"%>

<%
' *** Edit Operations: declare variables

MM_editAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables

If (CStr(Request("MM_insert")) <> "") Then

MM_editConnection = MM_connddb_STRING
MM_editTable = "db1"
MM_editRedirectUrl = "ru.asp"
MM_fieldsStr = "namecn|value|titlecn|value"
MM_columnsStr = "namecn|',none,''|titlecn|',none,''"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")

' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If

End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it

If (CStr(Request("MM_insert")) <> "") Then

' create the sql insert statement
MM_tablevalues = ""
MM_dbvalues = ""
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),",")
Delim = MM_typeArray(0)
If (Delim = "none") Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none") Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none") Then EmptyVal = ""
If (FormVal = "") Then
FormVal = EmptyVal
Else
If (AltVal <> "") Then
FormVal = AltVal
ElseIf (Delim = "'") Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''") & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_tablevalues = MM_tablevalues & ","
MM_dbvalues = MM_dbvalues & ","
End if
MM_tablevalues = MM_tablevalues & MM_columns(i)
MM_dbvalues = MM_dbvalues & FormVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tablevalues & ") values (" & MM_dbvalues & ")"

If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%>


Untitled Document




















忧忧

职务:普通成员
等级:1
金币:1.0
发贴:180
注册:2002/7/23 1:32:17
#22002/7/23 1:39:51
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
/site/free/TMP53zhnznlaq.asp, 第 88 行
重做数据库依然如此,我是用第三种方法做的,测试是成功的,我把代码上传上来请各位指点问题出在IE还是IIS,或ODBC?

说说第三种是什么样的方法!

/site/free/TMP53zhnznlaq.asp, 第 88 行
是那一行? :)
--------------------------------------------------------------------------------
80004005 ——数据源文件名没有被找到没有默认的驱动说明
80004005——操作系统必须被更新查找

80004005——Microsoft Jet database引擎不能打开文件(未知)

编辑历史:[这消息被忧忧编辑过(编辑时间2002-07-23 01:41:24)]


万木春

职务:普通成员
等级:1
金币:0.0
发贴:165
注册:2002/6/17 21:30:27
#32002/7/23 14:37:14
现在我找到问题所在,我把站点放在根目录,在IIS中在WWWROOT后设置了站点,事实证明不需要的,即主目录指向D:\INETPUB\WWWROOT即可.



qikuo

职务:普通成员
等级:1
金币:0.0
发贴:17
注册:2002/5/6 8:19:48
#42002/7/24 16:00:46
你改用OLE DB连接,我也有过类似的情况!!!!