主题:  错误详细信息,救救我!

xyjxzbj

职务:普通成员
等级:1
金币:0.0
发贴:23
注册:2002/1/8 9:44:38
#12002/1/8 14:24:42
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
/user/addbuy.asp, 第 90 行

目录:C:\interpub\wwwroot
插入数据库的文件路经:C:\interpub\wwwroot
\user\addbuy.asp
数据库的文件路经:C:\interpub\wwwroot\database\info.mdb
系统DSN连接成功
系统:Win2000server intranet 名称:wsj06
我的代码:

<%@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_info_STRING
MM_editTable = "buyadd"
MM_editRedirectUrl = ""
MM_fieldsStr = "name|value|company|value|agency|value|address|value|postcode|value|tel|value|mobile|value|bp|value|fax|value|Email|value|enddate|value|expecttype|value|year|value|runarea|value|hoderchange|value|expectprice|value|others|value"
MM_columnsStr = "name|',none,''|company|',none,''|agency|none,1,0|address|',none,''|postcode|',none,''|tel|',none,''|mobile|',none,''|bp|',none,''|fax|',none,''|E-mail|',none,''|enddate|',none,''|expecttype|',none,''|year|',none,''|runarea|',none,''|hoderchange|none,1,0|expectprice|',none,''|others|',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
%>


我想买车



 












































































Name:

Company:

Agency:

Address:

Postcode:

Tel:

Mobile:

Bp:

Fax:

E-mail:

Enddate:

Expecttype:

Year:

Runarea:

Hoderchange:

Expectprice:

Others:

 




 








5D公害

职务:普通成员
等级:9
金币:10.3
发贴:36272
注册:2002/1/13 9:52:57
#22002/1/16 13:04:43
这个问题很好改
因为你用的是DSN连接,改用SERVER.MAPPATH吧



5D公害

职务:普通成员
等级:9
金币:10.3
发贴:36272
注册:2002/1/13 9:52:57
#32002/1/16 13:47:06
插入数据的那个页面不要定义记录集。



kent

职务:普通成员
等级:1
金币:0.0
发贴:4
注册:2001/4/1 1:19:29
#42002/1/16 17:09:15
楼上的两位大侠能否说得再详细些!!
小弟是个笨笨鸟!!



xyjxzbj

职务:普通成员
等级:1
金币:0.0
发贴:23
注册:2002/1/8 9:44:38
#52002/1/17 8:49:10
谢谢!
问题已经解决,但我是重做了一遍,要学代码呀!
要学代码呀!痛定思痛!
要学代码呀!痛定思痛!



5D公害

职务:普通成员
等级:9
金币:10.3
发贴:36272
注册:2002/1/13 9:52:57
#62002/1/26 15:23:17
忘记了,是的,这个页面不用,也不能放这个,切记,切记