Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2004
    Posts
    4

    Unanswered: Cannot Connect Access Database With Iis!

    Hello everyone!
    I've recently created a db in access and incorporated it in an .asp page in dreamweaver.
    I've set my site fine in dmx but when I try to preview the page i get a display error, not a specific error but as if the page doesn't exist.
    This happens only to my db connected .asp page and not on my other .asp pages.
    I suppose that there is a way to tell IIS where the database is but I don't know how. Does anyone has any suggestions?

    Thank you
    Zeta

  2. #2
    Join Date
    Nov 2003
    Location
    Australia
    Posts
    36
    y don't u just use u're old connection method? - just overwrite dreamweavers where nessessary and dw - you can still edit the page after

    i suguest something like:



    databaseFile = "database.mdb"

    public function DBConnect(ors,qry,MDBName)
    curDir = Server.MapPath(MDBName)
    Set oConn = Server.CreateObject("ADODB.Connection")

    oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDir
    'oConn.Open="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & curDir

    Set oRs = Server.CreateObject("ADODB.Recordset")
    'Set oRs.ActiveConnection = oConn
    oRs.Open qry, oConn, 3, 3

    DBConnect=oRs
    end function

  3. #3
    Join Date
    Feb 2004
    Posts
    4
    Unfortunately, I don't understand any of that. My only problem is that I cannot preview the page for some reason.
    I need a method to connect IIS with my database.

    Anyone?
    Thanks again
    Zeta

  4. #4
    Join Date
    Nov 2003
    Location
    Australia
    Posts
    36
    what is the code of u;re dreamweaver page??

  5. #5
    Join Date
    Nov 2003
    Location
    Australia
    Posts
    36
    and i don't think u can specify a database in the iis itself --- if u must specify one you would do it in the "Data Sources (ODBC)" window under administrator tools in the control pannel

  6. #6
    Join Date
    Feb 2004
    Posts
    4
    Here's the code for the whole page:
    <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1253"%>
    <!--#include file="../Connections/connCal.asp" -->
    <%
    Dim RsDateDetails__MMParam
    RsDateDetails__MMParam = "1/2/2004"
    If (CDate(Request.QueryString("StartDate")) <> "") Then
    RsDateDetails__MMParam = CDate(Request.QueryString("StartDate"))
    End If
    %>
    <%
    Dim RsDateDetails
    Dim RsDateDetails_numRows

    Set RsDateDetails = Server.CreateObject("ADODB.Recordset")
    RsDateDetails.ActiveConnection = MM_connCal_STRING
    RsDateDetails.Source = "SELECT Description, Location FROM calendar WHERE StartDate=# " + Replace(RsDateDetails__MMParam, "'", "''") + " # ORDER BY EventID"
    RsDateDetails.CursorType = 0
    RsDateDetails.CursorLocation = 2
    RsDateDetails.LockType = 1
    RsDateDetails.Open()

    RsDateDetails_numRows = 0
    %>
    <%
    ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

    Dim RsDateDetails_total
    Dim RsDateDetails_first
    Dim RsDateDetails_last

    ' set the record count
    RsDateDetails_total = RsDateDetails.RecordCount

    ' set the number of rows displayed on this page
    If (RsDateDetails_numRows < 0) Then
    RsDateDetails_numRows = RsDateDetails_total
    Elseif (RsDateDetails_numRows = 0) Then
    RsDateDetails_numRows = 1
    End If

    ' set the first and last displayed record
    RsDateDetails_first = 1
    RsDateDetails_last = RsDateDetails_first + RsDateDetails_numRows - 1

    ' if we have the correct record count, check the other stats
    If (RsDateDetails_total <> -1) Then
    If (RsDateDetails_first > RsDateDetails_total) Then
    RsDateDetails_first = RsDateDetails_total
    End If
    If (RsDateDetails_last > RsDateDetails_total) Then
    RsDateDetails_last = RsDateDetails_total
    End If
    If (RsDateDetails_numRows > RsDateDetails_total) Then
    RsDateDetails_numRows = RsDateDetails_total
    End If
    End If
    %>

    <%
    ' *** Recordset Stats: if we don't know the record count, manually count them

    If (RsDateDetails_total = -1) Then

    ' count the total records by iterating through the recordset
    RsDateDetails_total=0
    While (Not RsDateDetails.EOF)
    RsDateDetails_total = RsDateDetails_total + 1
    RsDateDetails.MoveNext
    Wend

    ' reset the cursor to the beginning
    If (RsDateDetails.CursorType > 0) Then
    RsDateDetails.MoveFirst
    Else
    RsDateDetails.Requery
    End If

    ' set the number of rows displayed on this page
    If (RsDateDetails_numRows < 0 Or RsDateDetails_numRows > RsDateDetails_total) Then
    RsDateDetails_numRows = RsDateDetails_total
    End If

    ' set the first and last displayed record
    RsDateDetails_first = 1
    RsDateDetails_last = RsDateDetails_first + RsDateDetails_numRows - 1

    If (RsDateDetails_first > RsDateDetails_total) Then
    RsDateDetails_first = RsDateDetails_total
    End If
    If (RsDateDetails_last > RsDateDetails_total) Then
    RsDateDetails_last = RsDateDetails_total
    End If

    End If
    %>

    <!--#include file="../Connections/connection.asp" -->
    <%
    Dim offers
    Dim offers_numRows

    Set offers = Server.CreateObject("ADODB.Recordset")

    offers.Source = "SELECT * FROM calendar ORDER BY StartDate DESC"
    offers.CursorType = 0
    offers.CursorLocation = 2
    offers.LockType = 1
    offers.Open()

    offers_numRows = 0
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>

    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1253">
    <style type="text/css">
    <!--
    -->
    </style>
    <link href="../verdana.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) { //reloads the window if Nav4 resized
    if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
    else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    //-->
    </script>
    </head>

    <body>
    <table height="334" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td width="968" height="334" colspan="2" valign="top" class="text"><table width="667" height="330" border="1" cellpadding="0" cellspacing="0" bordercolor="52b026" class="text" id="march">
    <tr>
    <td width="155" height="83" valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col"><%=(RsDateDetails_first)%></th>
    </tr>
    </table>
    <br> </td>
    <td width="153" valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">16</th>
    </tr>
    </table></td>
    <td valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">17</th>
    </tr>
    </table></td>
    <td width="179" valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">18</th>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td height="83" valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">19</th>
    </tr>
    </table>
    ΑΘΗΝΑ :CARREFOUR N. IΩΝΙΑ/ ΑΒ ΒΡΙΛΗΣΙΑ </td>
    <td width="153" valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">20</th>
    </tr>
    </table>
    ΑΘΗΝΑ :CARREFOUR N. IΩΝΙΑ/ ΑΒ ΒΡΙΛΗΣΙΑ </td>
    <td valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">21</th>
    </tr>
    </table>
    ΑΘΗΝΑ :CARREFOUR N. IΩΝΙΑ/ ΑΒ ΒΡΙΛΗΣΙΑ </td>
    <td valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">22</th>
    </tr>
    </table>
    ΑΘΗΝΑ :CARREFOUR N. IΩΝΙΑ, ΜΑΡΟΥΣΙ / ΑΒ ΒΡΙΛΗΣΙΑ </td>
    </tr>
    <tr>
    <td height="83" valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">23</th>
    </tr>
    </table>
    ΑΘΗΝΑ :CARREFOUR N. IΩΝΙΑ, ΜΑΡΟΥΣΙ / ΑΒ ΒΡΙΛΗΣΙΑ </td>
    <td width="153" valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">24</th>
    </tr>
    </table></td>
    <td width="170" valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">25</th>
    </tr>
    </table></td>
    <td valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">26</th>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">27</th>
    </tr>
    </table>
    ΑΘΗΝΑ :CARREFOUR ΜΑΡΟΥΣΙ </td>
    <td width="153" height="83" valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">28</th>
    </tr>
    </table>
    ΑΘΗΝΑ :CARREFOUR ΜΑΡΟΥΣΙ </td>
    <td valign="top"><table width="20" height="20" border="0" cellpadding="0" cellspacing="0" bgcolor="#52B026">
    <tr>
    <th class="numbers" scope="col">29</th>
    </tr>
    </table>
    ΑΘΗΝΑ :CARREFOUR N. IΩΝΙΑ, ΜΑΡΟΥΣΙ / ΑΒ ΒΡΙΛΗΣΙΑ </td>
    <td valign="top" background="../calendar/back.gif">&nbsp;</td>
    </tr>
    </table></td>
    </tr>
    </table>
    </body>
    </html>
    <%
    RsDateDetails.Close()
    Set RsDateDetails = Nothing
    %>
    <%
    offers.Close()
    Set offers = Nothing
    %>

    THANK U AGAIN FOR THE HELP

  7. #7
    Join Date
    Feb 2004
    Posts
    4
    ALSO, LET ME NOTE THAT I CAN'T SEE ANY OF THE READY-MADE DREAMWEAVER DATABASES ON MY PC

Posting Permissions

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