Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Posts
    494

    Unanswered: PWS to another website

    How can I transfer the ASP and HTML files from PWS (Personnal Web Server) to my website?

    Code:
    Microsoft OLE DB Provider for ODBC Drivers error '80004005' 
    
    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 
    
    /wheelofgod/deuteronomy.asp, line 13

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    errr,... smartftp?? you have asked a bit of an open ended question... it appears that it's not the transfering that is a problem but the referencing of the database.

    How are you currently trying to connect? I would guess using a dsn. does your host support the creation of DSN's? If so, create one that is the same, if not you will need to change your method for connecting to the database so it uses something that is supported like mappath or something...

  3. #3
    Join Date
    Jul 2004
    Posts
    494

    the database is online too. Dsn still necessary??

    I uploaded the database too.

    But it seems that there's a rule on how to make the database accessible. It said this:



    Once you have made your database objects, next you must connect to a database and open table or run a query on a table. The table or query will get your RecordSet, a set of records that matches a special set of rules. These records may be updated, or you can add new records to the table that the record set was queried from, if it was queried from one table.

    To connection to a database you need to give the ADO's Connection object a DSN. In the case of DomainDLX that would be a DSN string that returns a DSN-Less connection. (confusing huh?) Well, we do this by calling the Open method.

    ADODB.Connection.Open DSNString

    To continue from the Starting Point page we would do the following to open a database:

    DSNStatement = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="
    DSNStatement = DSNStatement & Server.MapPath("/USERNAME/database/mydatabase.mdb")
    Conn.Open DSNStatement

    Now, your database is opened, you just need to open or query a table... This is a little trickier. A little SQL knowledge will help here. Here we will use SELECT * (to select any field) FROM Table (from the table Table) WHERE (((Table.Field)='Value') AND ((Table.Field2)='Value2')) (where the Field from Table = Value and the Field2 from Table = Value2). This will explain querying. The only time when you will use WHERE is when you want to query a select set of record where certain rules apply and in ( ) you place those rules. Once your table is selected and your rules set and put in a string you need to call the Open method for the Recordset object.

    ADODB.Recordset.Open SQLCommand, ActiveConnectoin, CursorType, LockType, Options

    Example:

    SQLStatement = "SELECT * FROM Table WHERE "
    SQLStatement = SQLStatement & (((Table.Field)='Value) AND ((Table.Field2)='Value2'))
    RS.Open SQLStatement, Conn, 3, 3
    'These options will open the database for writing while allowing others to still read it.
    Unfortunately the guy who wrote the article left. He has a small homepage with an email but says, "don't write to me concerning ASP anymore".

    I'll post what my ASP code says next posting.

  4. #4
    Join Date
    Jul 2004
    Posts
    494

    Here it is

    Here it is:

    <%@ LANGUAGE="VBSCRIPT" %>
    <html>
    <head>
    <TITLE>deuteronomy.asp</TITLE>
    </head>

    <body>
    <%
    SqlBible = "SELECT * FROM deuteronomy WHERE "


    Set dbGlobalWeb = Server.CreateObject("ADODB.Connection")
    dbGlobalWeb.Open("bible")

    dim mySearch, iCounter
    mySearch=Request.QueryString("mySearch")
    iCounter = 0

    If request.QueryString("book")="yes" then

    SqlBible = SqlBible & "book LIKE '%" & mySearch & "%'"

    iCounter = iCounter + 1

    end if

    If request.QueryString("spoke")="yes" then

    If iCounter > 0 Then
    SqlBible = SqlBible & " OR "
    End If

    SqlBible = SqlBible & "spoke LIKE '%" & mySearch & "%'"

    iCounter = iCounter + 1

    end if

    If request.QueryString("book_title")="yes" then

    If iCounter > 0 Then
    SqlBible = SqlBible & " OR "
    End If

    SqlBible = SqlBible & "book_title LIKE '%" & mySearch & "%'"

    iCounter = iCounter + 1

    end if

    If request.QueryString("chapter")="yes" then

    If iCounter > 0 Then
    SqlBible = SqlBible & " OR "
    End If

    SqlBible = SqlBible & "chapter LIKE '%" & mySearch & "%'"

    iCounter = iCounter + 1

    end if

    If request.QueryString("verse")="yes" then

    If iCounter > 0 Then
    SqlBible = SqlBible & " OR "
    End If

    SqlBible = SqlBible & "verse LIKE '%" & mySearch & "%'"

    iCounter = iCounter + 1

    end if

    If request.QueryString("text_data")="yes" then

    If iCounter > 0 Then
    SqlBible = SqlBible & " OR "
    End If

    SqlBible = SqlBible & "text_data LIKE '%" & mySearch & "%'"

    iCounter = iCounter + 1

    end if

    Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset")
    rsGlobalWeb.Open SqlBible, dbGlobalWeb, 3%>

    <%
    If rsGlobalWeb.BOF and rsGlobalWeb.EOF Then%>

    <h2 align="center">We did not find a match!</h2>
    <%Else%>


    <%If Not rsGlobalWeb.BOF Then%>

    <h2>These are the results:</h2>

    <table BORDER="0" width="100%" cellpadding="3">
    <tr>
    <th bgcolor="#800000"><font face="Arial" color="#FFFFFF">Book </font></th>
    <th bgcolor="#800000"><font face="Arial" color="#FFFFFF">Spoke </font></th>
    <th bgcolor="#800000"><font face="Arial" color="#FFFFFF">Book Title </font></th>
    <th bgcolor="#800000"><font face="Arial" color="#FFFFFF">Chapter </font></th>
    <th bgcolor="#800000"><font face="Arial" color="#FFFFFF">Verse </font></th>
    <th bgcolor="#800000"><font face="Arial" color="#FFFFFF">Text </font></th>
    </tr>
    <%
    Do While Not rsGlobalWeb.EOF
    %>
    <tr>
    <td><%=rsGlobalWeb("book")%>&#32
    </td>
    <td><%=rsGlobalWeb("spoke")%>
    </td>
    <td><%=rsGlobalWeb("book_title")%>
    </td>
    <td><%=rsGlobalWeb("chapter")%>
    </td>
    <td><%=rsGlobalWeb("verse")%>
    </td>
    <td><%=rsGlobalWeb("text_data")%>
    </td>
    </tr>
    <% rsGlobalWeb.MoveNext
    Loop
    %>
    </table>
    <%End If%>
    <%End If%>
    <%
    rsGlobalWeb.Close
    dbGlobalWeb.Close
    %>
    </body>
    </html>

  5. #5
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    <<
    How can I transfer the ASP and HTML files from PWS (Personnal Web Server) to my website?
    >>

    You can FTP by copying and pasting with Windows Explorer or Internet Explorer and here is an example:
    ftp://usernameassword@mysite.com

    And sometimes this works too:
    ftp://mysite.com and then asked for username and password

    And here's an interesting resource that hopefully might help:

    Why do I get database-related 80004005 errors?
    http://www.aspfaq.com/show.asp?id=2009
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

  6. #6
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Okie, so you are having problems gettnig your web pages to open your db from the sounds of things...

    The key is here...

    DSNStatement = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="
    DSNStatement = DSNStatement & Server.MapPath("/USERNAME/database/mydatabase.mdb")
    Conn.Open DSNStatement
    I assume on your local machine you create a DSN,... well on your remote server you can't create one so you need to use the Server.MapPath options (shown above) to open your database. Change the path above ("/USERNAME/database/mydatabase.mdb") to point to you database and you should be right....

Posting Permissions

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