Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Re: help with asp code

    [url]http://www.aspfaq.com/show.asp?id=2109[/url]

    Pets2adopt wrote:
    > The error i'm getting is the page will not load. it seams that any
    > asp code that i'm dropping onto the server is not loading
    >
    > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > news:#3#FmsePDHA.1380@TK2MSFTNGP11.phx.gbl...
    >> What errors?
    >>
    >> You should switch to the native Jet OLEDB provider instead of ODBC -
    >> see [url]www.able-consulting.com/ado_conn.htm[/url] for examples.
    >>
    >> HTH,
    >> Bob Barrows
    >>
    >> Pets2adopt wrote:
    >>> can anyone let me know why the code bellow is creating errors I'm
    >>> trying to connect to a access data base then display the results of
    >>> what's in the data base.
    >>>
    >>> thank you for any help that you can offer
    >>>
    >>>
    >>>
    >>> <%@ Language=VBSCRIPT %>
    >>> <% Option Explicit %>
    >>> <!--#include virtual="/adovbs.inc"-->
    >>> <%
    >>> 'create a connection to our database that contains the
    >>>
    >>> Dim objConn
    >>> Set objConn = Server.CreateObject("ADODB.Connection")
    >>> objConn.ConnectionString="Driver={Microsoft Access Driver
    >>> (*.mdb)};" &_ "DBQ=K:\myweb3\fpdb\storesdb.mdb"
    >>> objConn.Open
    >>>
    >>>
    >>>
    >>> ' create a recordset object
    >>> Dim objRS
    >>> Set objRS = Server.CreateObject("ADODB.Recordset")
    >>>
    >>> ' open the recordset
    >>> objRS.Open "store_info", objConn, , , adCmdTable
    >>>
    >>>
    >>>
    >>> ' display the results
    >>> Do While not objRS.EOF
    >>> response.write "<B>" & objRS("City") & "</b><br>"
    >>> response.write "<br>objRS("Store_Name") & "<BR>"
    >>>
    >>>
    >>>
    >>> ' move to the next record
    >>> objRS.MoveNext
    >>> Loop
    >>>
    >>> ' clean up !!
    >>> objRS.Close
    >>> set objRS = Nothing
    >>>
    >>> objConn.close
    >>> set objConn = nothing
    >>>
    >>> %>


    Bob Barrows Guest

  2. Similar Questions and Discussions

    1. Why doesn't the Code Completion occur in FlexBuilder IDEwhen source code is in an external file?
      I am seperating my .as from the MXML by using the following in my file.mxml: <mx:Script source="file.as"> When I edit file.as, the code...
    2. How would I include the Open Browser code into this lineof code?
      Hello and thankyou in advance: I have an ASP page linked to my database and I want to apply the Open Browser behaviour to the code. I have tried...
    3. Custom control fires event but ignores some code in the code behind file
      I do not quite understand the question. I will merely point out that most programming problems happen for a reason. Code works the way it is...
    4. Custom tool warning: DiscoCodeGenerator unable to initialize code generator. No code generated.
      I created a brand new WebService (HelloWorld) and when I attempt to add this WebService to a WindowsForm project I get the following error message in...
    5. Security problem with Managed Code calling Unmanaged Code in a Web Page
      Hello, I have a web page which contains an ActiveX control (unmanaged) and a Windows Forms User Control (managed). Both reside on a web page and...
  3. #2

    Default Re: help with asp code

    Thanks Bob I managed to get past most of my errors but I have one more
    question for you or for the group.
    I'm now getting the following error


    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    registry key 'Temporary (volatile) Jet DSN for process 0x4798 Thread 0x4670
    DBC 0x2397adc Jet'.

    /storesearch.asp, line 10

    the new code is listed bellow

    <%@ Language=VBSCRIPT %>
    <% Option Explicit %>
    <%
    'create a connection to our database that contains the

    Dim objConn
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" &_
    "DBQ=www.web/fpdb/storesdb.mdb"
    objConn.Open



    ' create a recordset object
    Dim objRS
    Set objRS = Server.CreateObject("ADODB.Recordset")

    ' open the recordset
    objRS.Open "store_info", objConn, , , adCmdTable



    ' display the results
    Do While not objRS.EOF
    response.write "<B>" & objRS("City") & "</b><br>"
    response.write "<br>" & objRS("Store_Name") & "<BR>"



    ' move to the next record
    objRS.MoveNext
    Loop

    ' clean up !!
    objRS.Close
    set objRS = Nothing

    objConn.close
    set objConn = nothing

    %>


    Any more help that you provide would be appreciated


    "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    news:OzSWSKkPDHA.2036@TK2MSFTNGP10.phx.gbl...
    > [url]http://www.aspfaq.com/show.asp?id=2109[/url]
    >
    > Pets2adopt wrote:
    > > The error i'm getting is the page will not load. it seams that any
    > > asp code that i'm dropping onto the server is not loading
    > >
    > > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > > news:#3#FmsePDHA.1380@TK2MSFTNGP11.phx.gbl...
    > >> What errors?
    > >>
    > >> You should switch to the native Jet OLEDB provider instead of ODBC -
    > >> see [url]www.able-consulting.com/ado_conn.htm[/url] for examples.
    > >>
    > >> HTH,
    > >> Bob Barrows
    > >>
    > >> Pets2adopt wrote:
    > >>> can anyone let me know why the code bellow is creating errors I'm
    > >>> trying to connect to a access data base then display the results of
    > >>> what's in the data base.
    > >>>
    > >>> thank you for any help that you can offer
    > >>>
    > >>>
    > >>>
    > >>> <%@ Language=VBSCRIPT %>
    > >>> <% Option Explicit %>
    > >>> <!--#include virtual="/adovbs.inc"-->
    > >>> <%
    > >>> 'create a connection to our database that contains the
    > >>>
    > >>> Dim objConn
    > >>> Set objConn = Server.CreateObject("ADODB.Connection")
    > >>> objConn.ConnectionString="Driver={Microsoft Access Driver
    > >>> (*.mdb)};" &_ "DBQ=K:\myweb3\fpdb\storesdb.mdb"
    > >>> objConn.Open
    > >>>
    > >>>
    > >>>
    > >>> ' create a recordset object
    > >>> Dim objRS
    > >>> Set objRS = Server.CreateObject("ADODB.Recordset")
    > >>>
    > >>> ' open the recordset
    > >>> objRS.Open "store_info", objConn, , , adCmdTable
    > >>>
    > >>>
    > >>>
    > >>> ' display the results
    > >>> Do While not objRS.EOF
    > >>> response.write "<B>" & objRS("City") & "</b><br>"
    > >>> response.write "<br>objRS("Store_Name") & "<BR>"
    > >>>
    > >>>
    > >>>
    > >>> ' move to the next record
    > >>> objRS.MoveNext
    > >>> Loop
    > >>>
    > >>> ' clean up !!
    > >>> objRS.Close
    > >>> set objRS = Nothing
    > >>>
    > >>> objConn.close
    > >>> set objConn = nothing
    > >>>
    > >>> %>
    >
    >
    >

    Pets2adopt Guest

  4. #3

    Default Re: help with asp code

    Thanksfor the help Ken, it worked i'll try and change the code now to the
    oledb provider


    "Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
    news:urwXl8rPDHA.1748@TK2MSFTNGP11.phx.gbl...
    > Your connection string is not valid. The DBQ= parameter requires a
    physical
    > path, eg c:\inetpub\wwwroot\fpdb\myDatabase.mdb YOu can use
    Server.Mappath()
    > to get this value.
    >
    > eg:
    >
    > <%
    > strConnect = _
    > "Driver={Microsoft Access Driver (*.mdb)};" & _
    > "DBQ=" & Server.Mappath("/fpdb/StoresDB.mdb") & ";"
    >
    > objConn.Open strConnect
    > %>
    >
    > However, it is recommended you use the OLEDB Provider instead:
    >
    > strConnect = _
    > "Provider=Microsoft.Jet.OLEBD.4.0;" & _
    > "Data Source=" & Server.Mappath("/fpdb/StoresDB.mdb") & ";"
    >
    > Cheers
    > Ken
    >
    >
    > "Pets2adopt" <pets2adopt@rogers.com> wrote in message
    > news:bcKLa.18264$x4o.5529@news04.bloor.is.net.cabl e.rogers.com...
    > : Thanks Bob I managed to get past most of my errors but I have one more
    > : question for you or for the group.
    > : I'm now getting the following error
    > :
    > :
    > : Microsoft OLE DB Provider for ODBC Drivers error '80004005'
    > :
    > : [Microsoft][ODBC Microsoft Access Driver]General error Unable to open
    > : registry key 'Temporary (volatile) Jet DSN for process 0x4798 Thread
    > 0x4670
    > : DBC 0x2397adc Jet'.
    > :
    > : /storesearch.asp, line 10
    > :
    > : the new code is listed bellow
    > :
    > : <%@ Language=VBSCRIPT %>
    > : <% Option Explicit %>
    > : <%
    > : 'create a connection to our database that contains the
    > :
    > : Dim objConn
    > : Set objConn = Server.CreateObject("ADODB.Connection")
    > : objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" &_
    > : "DBQ=www.web/fpdb/storesdb.mdb"
    > : objConn.Open
    > :
    > :
    > :
    > : ' create a recordset object
    > : Dim objRS
    > : Set objRS = Server.CreateObject("ADODB.Recordset")
    > :
    > : ' open the recordset
    > : objRS.Open "store_info", objConn, , , adCmdTable
    > :
    > :
    > :
    > : ' display the results
    > : Do While not objRS.EOF
    > : response.write "<B>" & objRS("City") & "</b><br>"
    > : response.write "<br>" & objRS("Store_Name") & "<BR>"
    > :
    > :
    > :
    > : ' move to the next record
    > : objRS.MoveNext
    > : Loop
    > :
    > : ' clean up !!
    > : objRS.Close
    > : set objRS = Nothing
    > :
    > : objConn.close
    > : set objConn = nothing
    > :
    > : %>
    > :
    > :
    > : Any more help that you provide would be appreciated
    > :
    > :
    > : "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > : news:OzSWSKkPDHA.2036@TK2MSFTNGP10.phx.gbl...
    > : > [url]http://www.aspfaq.com/show.asp?id=2109[/url]
    > : >
    > : > Pets2adopt wrote:
    > : > > The error i'm getting is the page will not load. it seams that any
    > : > > asp code that i'm dropping onto the server is not loading
    > : > >
    > : > > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > : > > news:#3#FmsePDHA.1380@TK2MSFTNGP11.phx.gbl...
    > : > >> What errors?
    > : > >>
    > : > >> You should switch to the native Jet OLEDB provider instead of
    ODBC -
    > : > >> see [url]www.able-consulting.com/ado_conn.htm[/url] for examples.
    > : > >>
    > : > >> HTH,
    > : > >> Bob Barrows
    > : > >>
    > : > >> Pets2adopt wrote:
    > : > >>> can anyone let me know why the code bellow is creating errors I'm
    > : > >>> trying to connect to a access data base then display the results
    of
    > : > >>> what's in the data base.
    > : > >>>
    > : > >>> thank you for any help that you can offer
    > : > >>>
    > : > >>>
    > : > >>>
    > : > >>> <%@ Language=VBSCRIPT %>
    > : > >>> <% Option Explicit %>
    > : > >>> <!--#include virtual="/adovbs.inc"-->
    > : > >>> <%
    > : > >>> 'create a connection to our database that contains the
    > : > >>>
    > : > >>> Dim objConn
    > : > >>> Set objConn = Server.CreateObject("ADODB.Connection")
    > : > >>> objConn.ConnectionString="Driver={Microsoft Access Driver
    > : > >>> (*.mdb)};" &_ "DBQ=K:\myweb3\fpdb\storesdb.mdb"
    > : > >>> objConn.Open
    > : > >>>
    > : > >>>
    > : > >>>
    > : > >>> ' create a recordset object
    > : > >>> Dim objRS
    > : > >>> Set objRS = Server.CreateObject("ADODB.Recordset")
    > : > >>>
    > : > >>> ' open the recordset
    > : > >>> objRS.Open "store_info", objConn, , , adCmdTable
    > : > >>>
    > : > >>>
    > : > >>>
    > : > >>> ' display the results
    > : > >>> Do While not objRS.EOF
    > : > >>> response.write "<B>" & objRS("City") & "</b><br>"
    > : > >>> response.write "<br>objRS("Store_Name") & "<BR>"
    > : > >>>
    > : > >>>
    > : > >>>
    > : > >>> ' move to the next record
    > : > >>> objRS.MoveNext
    > : > >>> Loop
    > : > >>>
    > : > >>> ' clean up !!
    > : > >>> objRS.Close
    > : > >>> set objRS = Nothing
    > : > >>>
    > : > >>> objConn.close
    > : > >>> set objConn = nothing
    > : > >>>
    > : > >>> %>
    > : >
    > : >
    > : >
    > :
    > :
    >
    >

    chippy Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139