Forums

ASP

This topic is locked

ActiveConnection

Posted 07 Jan 2008 20:16:42
1
has voted
07 Jan 2008 20:16:42 Oriyomi Shokunbi posted:

Hi
I tried to insert record in my .asp but it gave me the error type below
The error on line 113 is MM_editCmd.ActiveConnection = MM_editConnection.
I am using a ms access as dbase

Thanks
Yomi


Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x898 Thread 0xccc DBC 0x3420064 Jet'.
/dpisiteasp/regd.asp, line 113
• Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; FDM)
• Page:
POST 319 bytes to /dpisiteasp/regd.asp
• POST Data:
TEAM=j&FIRST=j&LAST=j&EMAIL=j&NATIONALITY=j&STATEO=j&SCHOOL=j&SCHOOLADDRESS=j&SCHOOLPHONE=j&Class=j&Class1=j&MONTH=j&DAY=j&YEAR=j&GENDER=j&ADDRESS=j&ADDRESS2=j&CITY=j&STATE=k&COUNTRY=k&PHONE=k&PARENT= . . .
• Time:
Friday, January 04, 2008, 2:09:33 AM
Here is my script
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/dpia.asp" -->
<%
' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")
If (Request.QueryString <> "" Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(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") = "form1" Then

MM_editConnection = MM_dpia_STRING
MM_editTable = "REGISTER"
MM_editRedirectUrl = "thanks.asp"
MM_fieldsStr = "ID|value|TEAM|value|FIRST|value|LAST|value|EMAIL|value|NATIONALITY|value|STATEO|value|SCHOOL|value|SCHOOLADDRESS|value|SCHOOLPHONE|value|Class|value|Class1|value|MONTH|value|DAY|value|YEAR|value|GENDER|value|ADDRESS|value|ADDRESS2|value|CITY|value|STATE|value|COUNTRY|value|PHONE|value|PARENT|value|PARENTEMAIL|value|PARENTPHONE|value|BANK|value|TELLERNO|value|MEDICAL|value|ALLERGY|value|USERNAME|value|PASSWORD|value|RegDate|value"
MM_columnsStr = "ID|none,none,NULL|TEAM|',none,''|FIRST|',none,''|LAST|',none,''|EMAIL|',none,''|NATIONALITY|',none,''|STATEO|',none,''|SCHOOL|',none,''|SCHOOLADDRESS|',none,''|SCHOOLPHONE|',none,''|Class|',none,''|Class1|',none,''|MONTH|',none,''|DAY|',none,''|YEAR|',none,''|GENDER|',none,''|ADDRESS|',none,''|ADDRESS2|',none,''|CITY|',none,''|STATE|',none,''|COUNTRY|',none,''|PHONE|',none,''|PARENT|',none,''|PARENTEMAIL|',none,''|PARENTPHONE|',none,''|BANK|',none,''|TELLERNO|',none,''|MEDICAL|',none,''|ALLERGY|',none,''|USERNAME|',none,''|PASSWORD|',none,''|RegDate|',none,''"

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

' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_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

Dim MM_tableValues
Dim MM_dbValues

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

' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),","
MM_delim = MM_typeArray(0)
If (MM_delim = "none" Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none" Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none" Then MM_emptyVal = ""
If (MM_formVal = "" Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "" Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'" Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''" & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_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
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form method="post" action="<%=MM_editAction%>" name="form1">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">TEAM:</td>
<td><input type="text" name="TEAM" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">FIRST:</td>
<td><input type="text" name="FIRST" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">LAST:</td>
<td><input type="text" name="LAST" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">EMAIL:</td>
<td><input type="text" name="EMAIL" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">NATIONALITY:</td>
<td><input type="text" name="NATIONALITY" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">STATEO:</td>
<td><input type="text" name="STATEO" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">SCHOOL:</td>
<td><input type="text" name="SCHOOL" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">SCHOOLADDRESS:</td>
<td><input type="text" name="SCHOOLADDRESS" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">SCHOOLPHONE:</td>
<td><input type="text" name="SCHOOLPHONE" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Class:</td>
<td><input type="text" name="Class" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Class1:</td>
<td><input type="text" name="Class1" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">MONTH:</td>
<td><input type="text" name="MONTH" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">DAY:</td>
<td><input type="text" name="DAY" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">YEAR:</td>
<td><input type="text" name="YEAR" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">GENDER:</td>
<td><input type="text" name="GENDER" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">ADDRESS:</td>
<td><input type="text" name="ADDRESS" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">ADDRESS2:</td>
<td><input type="text" name="ADDRESS2" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">CITY:</td>
<td><input type="text" name="CITY" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">STATE:</td>
<td><input type="text" name="STATE" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">COUNTRY:</td>
<td><input type="text" name="COUNTRY" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">PHONE:</td>
<td><input type="text" name="PHONE" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">PARENT:</td>
<td><input type="text" name="PARENT" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">PARENTEMAIL:</td>
<td><input type="text" name="PARENTEMAIL" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">PARENTPHONE:</td>
<td><input type="text" name="PARENTPHONE" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">BANK:</td>
<td><input type="text" name="BANK" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">TELLERNO:</td>
<td><input type="text" name="TELLERNO" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">MEDICAL:</td>
<td><input type="text" name="MEDICAL" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">ALLERGY:</td>
<td><input type="text" name="ALLERGY" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">USERNAME:</td>
<td><input type="text" name="USERNAME" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">PASSWORD:</td>
<td><input type="text" name="PASSWORD" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">RegDate:</td>
<td><input type="text" name="RegDate" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Insert record">
</td>
</tr>
</table>
<input type="hidden" name="ID" value="" >
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</body>
</html>


Urmy

Replies

Replied 09 Jan 2008 23:27:03
09 Jan 2008 23:27:03 Javier Castro replied:
make sure you have write permissions for your DB file.
Look at this link to see possible reasons as to why you get that error:
tutorials.aspfaq.com/8000xxxxx-errors/80004005-errors.html

Reply to this topic