Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: ODBC Drivers (0x80004005) Error!


Message #1 by "Alex Burlison" <alex@b...> on Fri, 8 Jun 2001 11:02:24
I have a some asp code to add a record to an Access Database. However I 

get this error:-



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 0x158 Thread 0x864 DBC 0x2010064 Jet'.



The asp code is as below. I have not shown the arrays at the top of the 

code but they just set up the field names and sizes.



It would be most appreciated if anyone could point me in the right 

direction.





Alex



</head>



<body class="backgndfixed">



    <% 

        ScriptName = Request.ServerVariables("SCRIPT_NAME")

        ScriptNameParts = Split(ScriptName, "/", -1)

        ScriptName = ScriptNameParts(Ubound(ScriptNameParts))

        BaseLoc = Left(Request.ServerVariables("PATH_TRANSLATED"), Len

(Request.ServerVariables("PATH_TRANSLATED"))-Len(ScriptName))



        DBasePath = BaseLoc & DBase & ";"



        IF request.form ("Message")<>"True" THEN 

   

            Response.write(PageHeader)



    %>



            <form action=<%= ScriptName %> method="POST" name="frmForm">

            <input type="hidden" name="Message" value="True">



            <table border="0" class="bodyboldw">



    <%  

                For Field = Lbound(Fields) To Ubound(Fields) 

    %>

                    <tr>

                        <td>

                            <div align="right"><%= Labels(Field)%>:</font>

                        </td>

                        <td>

    <%                      If Ucase(FieldTypes(Field)) = "TEXT" Then %>

                                <input type="text" size="<%= 

FormFieldLengths(Field)%>" name="<%= Fields(Field)%>" maxlength="<%= 

DBFieldLengths(Field)%>">

    <%                      Else If Ucase(FieldTypes(Field)) = "CHECKBOX" 

Then %>

                                    <input type="checkbox" name="<%= Fields

(Field)%>">

    <%                      Else If Ucase(FieldTypes(Field)) = "TEXTAREA" 

Then %>

                                        <textarea name="<%= Fields(Field)%

>" rows=<%= int(FormFieldLengths(Field))%> cols=<%= (FormFieldLengths

(Field) - int(FormFieldLengths(Field)))*1000 %>></textarea>

    <%                              End If %>

    <%                          End If %>

    <%                      End If %>

                        </td>

                    </tr> 

    <%  

                Next 

    %>

                <tr>

                    <td></td>

                    <td>

                        <input type="submit" value="<% = ButtonText %>"> 

                    </td>

                </tr>

            </table>

            </form>



            <SCRIPT LANGUAGE="VBScript">

                <!--

                    document.frmForm.<%=Fields(0)%>.focus

                -->

            </SCRIPT>



    <%

        Else



   	    strProvider="Driver=Microsoft Access Driver (*.mdb); DBQ=" & 

DBasePath

	    set objConn = server.createobject("ADODB.Connection")

            objConn.Open strProvider



	    set cm = Server.CreateObject("ADODB.Command")

	    cm.ActiveConnection = objConn



   	    cm.CommandText = "INSERT INTO " & TableName & "("

	    For Field = Lbound(Fields) To Ubound(Fields)

                cm.CommandText = cm.CommandText & Fields(Field)

                If Field < Ubound(Fields) Then cm.CommandText = 

cm.CommandText & ","

            Next

            cm.CommandText = cm.CommandText & ") VALUES ("

	    For Field = Lbound(Fields) To Ubound(Fields)

                cm.CommandText = cm.CommandText & "?"

                If Field < Ubound(Fields) Then cm.CommandText = 

cm.CommandText & ","

            Next

            cm.CommandText = cm.CommandText & ")"



	    For Field = Lbound(Fields) To Ubound(Fields)

                If Ucase(FieldTypes(Field)) = "TEXT" Or Ucase(FieldTypes

(Field)) = "TEXTAREA" Then

    	            set objparam=cm.createparameter(, 200, , DBFieldLengths

(Field), request.form(Fields(Field)))

                Else If Ucase(FieldTypes(Field)) = "CHECKBOX" Then

			If request.form(Fields(Field)) = "on" Then

                            chkValue = 1

                        Else 

                            chkValue = 0

                        End If

        	        set objparam=cm.createparameter(, 200, , 1, 

chkValue)

                    End If

                End If

   	        cm.parameters.append objparam

            Next



	    cm.execute

            objConn.Close



	    response.write(ConfirmText)  



        End if

    %>



</body>

</html>
Message #2 by Vincent Vandermeeren <vincentvdm@O...> on Fri, 8 Jun 2001 15:11:12 +0200
You get this error when tehconenction to your database isn't correct ....

check your path .....

Greetings,

vinnie



-----Original Message-----

From: Alex Burlison [mailto:alex@b...]

Sent: vrijdag 8 juni 2001 13:02

To: ASP Database Setup

Subject: [asp_database_setup] ODBC Drivers (0x80004005) Error!





I have a some asp code to add a record to an Access Database. However I 

get this error:-



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 0x158 Thread 0x864 DBC 0x2010064 Jet'.

Message #3 by "Alex Burlison" <alex@b...> on Sun, 10 Jun 2001 20:18:59
Vinnie,



Thanks for that, it solved the problem.





Alex


  Return to Index