If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > PWS to another website

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-26-04, 17:59
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
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
Reply With Quote
  #2 (permalink)  
Old 07-26-04, 19:00
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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...
Reply With Quote
  #3 (permalink)  
Old 07-27-04, 11:29
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
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:

Quote:


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.
Reply With Quote
  #4 (permalink)  
Old 07-27-04, 11:38
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
Here it is

Here it is:

Quote:
<%@ 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>
Reply With Quote
  #5 (permalink)  
Old 07-27-04, 15:49
Bullschmidt Bullschmidt is offline
Guru
 
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
Reply With Quote
  #6 (permalink)  
Old 07-27-04, 19:14
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Okie, so you are having problems gettnig your web pages to open your db from the sounds of things...

The key is here...

Quote:
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....
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On