p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: RE: Putting a Simple Database on the Web?


Message #1 by "Webmaster" <webmaster@c...> on Thu, 20 Jun 2002 18:21:36 +0100
In the same folder as the asp script!

An example is below: (it should work, so I've been told)
<html>
<head>
	<title> Links Page </title>
</head>

<body>
<font face="Verdana,Arial" size="2">

<b>Links Page</b><p>

<%

' Establish Database Connection
Set conn = Server.CreateObject("ADODB.Connection")
connStr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("links.mdb")
Conn.Open connStr
Set Session("myConn") = conn

' Open RecordSet, Sorted by Category & Alphabetically
' Database Table: Links

strSQLQuery = "SELECT * FROM Links ORDER BY LinkCategoryID, LinkName"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQLQuery, conn, 3, 3

' Display Links in Category 1
rs.Filter = "LinkCategoryID = 1"
Response.write("Category 1<p>" & vbCrLf)
	do until rs.eof
		strLinkURL = rs("LinkURL")
		strLinkName = rs("LinkName")
		strLinkDescription = rs("LinkDescription")
		strLinkCategoryID = rs("LinkCategoryID")
		strLinkAddedDate = rs("LinkAddedDate")
		response.write("<a href=""" & strLinkURL & """>" & strLinkName &
"</a><br>" & vbCrLf)
		If Len(strLinkDescription) > 4 Then response.write(strLinkDescription &
"<br>" & vbCrLf)
		rs.movenext
	loop
rs.Filter = 0

' Display Links in Category 2
rs.Filter = "LinkCategoryID = 2"
Response.write("Category 2<p>" & vbCrLf)
	do until rs.eof
		strLinkURL = rs("LinkURL")
		strLinkName = rs("LinkName")
		strLinkDescription = rs("LinkDescription")
		strLinkCategoryID = rs("LinkCategoryID")
		strLinkAddedDate = rs("LinkAddedDate")
		response.write("<a href=""" & strLinkURL & """>" & strLinkName &
"</a><br>" & vbCrLf)
		If Len(strLinkDescription) > 4 Then response.write(strLinkDescription &
"<br>" & vbCrLf)
		rs.movenext
	loop
rs.Filter = 0

' Add as many categories as you like

' Close Database Connection
conn.close
Set conn = Nothing
%>


</BODY>
</HTML>

-----Original Message-----
From: Jayne.Castellucci@L...
[mailto:Jayne.Castellucci@L...]
Sent: 20 June 2002 18:18
To: ASP Databases
Subject: [asp_databases] RE: Putting a Simple Database on the Web?


Where r u putting your db? What is your connection statement?

JC





-----Original Message-----
From: webmaster@c... [mailto:webmaster@c...]
Sent: Thursday, June 20, 2002 2:24 PM
To: ASP Databases
Subject: [asp_databases] Putting a Simple Database on the Web?


Sorry to ask this seemingly simple question but I've been trying to place
a simple database on the web.

When I do so the response is:

ADODB.Connection.1 error '800a0bb9'

The application is using arguments that are of the wrong type, are out of
acceptable range, or are in conflict with one another.

/asp/linkspage.asp, line 22

I have tried a number of sample codes from different places without
success.  And yet they all run on PWS.

My hosting company has

Apache/1.3.22 (Unix) PHP/4.0.6 FrontPage/5.0.2.2510
CHILI!ASP/DISPINT10 (3.6.0.809; Mar 28 2001)
Linux/#1 SMP Wed Mar 13 12:39:13 EST 20022.2.19-6.2.16smp

Is there something that I am overlooking?  Although I am a beginner to ASP
I have used Miva Script and HTML extensively.

I would be very grateful for any advise.

Patxi

P.S. I already have Active Server Pages 3.0 (wrox) but am running out of
ideas.


Message #2 by "Castellucci, Jayne" <Jayne.Castellucci@L...> on Thu, 20 Jun 2002 13:29:14 -0400
I'm not 100% sure, but I think you may need to declare the actual path
in DBQ, as:

connStr =3D "DRIVER=3D{Microsoft Access Driver (*.mdb)};
DBQ=3DC:\inetpub\wwwroot\..."

I guess the path would vary depending on where your inetpub\wwwroot
directory is.

I'm sorry, that's all I can think of. Good luck.

JC



-----Original Message-----
From: Webmaster [mailto:webmaster@c...]
Sent: Thursday, June 20, 2002 1:22 PM
To: ASP Databases
Subject: [asp_databases] RE: Putting a Simple Database on the Web?


In the same folder as the asp script!

An example is below: (it should work, so I've been told)
<html>
<head>
	<title> Links Page </title>
</head>

<body>
<font face=3D"Verdana,Arial" size=3D"2">

<b>Links Page</b><p>

<%

' Establish Database Connection
Set conn =3D Server.CreateObject("ADODB.Connection")
connStr =3D "DRIVER=3D{Microsoft Access Driver (*.mdb)}; DBQ=3D" &
Server.MapPath("links.mdb")
Conn.Open connStr
Set Session("myConn") =3D conn

' Open RecordSet, Sorted by Category & Alphabetically
' Database Table: Links

strSQLQuery =3D "SELECT * FROM Links ORDER BY LinkCategoryID, LinkName"
Set rs =3D Server.CreateObject("ADODB.Recordset")
rs.Open strSQLQuery, conn, 3, 3

' Display Links in Category 1
rs.Filter =3D "LinkCategoryID =3D 1"
Response.write("Category 1<p>" & vbCrLf)
	do until rs.eof
		strLinkURL =3D rs("LinkURL")
		strLinkName =3D rs("LinkName")
		strLinkDescription =3D rs("LinkDescription")
		strLinkCategoryID =3D rs("LinkCategoryID")
		strLinkAddedDate =3D rs("LinkAddedDate")
		response.write("<a href=3D""" & strLinkURL & """>" &
strLinkName & "</a><br>" & vbCrLf)
		If Len(strLinkDescription) > 4 Then
response.write(strLinkDescription & "<br>" & vbCrLf)
		rs.movenext
	loop
rs.Filter =3D 0

' Display Links in Category 2
rs.Filter =3D "LinkCategoryID =3D 2"
Response.write("Category 2<p>" & vbCrLf)
	do until rs.eof
		strLinkURL =3D rs("LinkURL")
		strLinkName =3D rs("LinkName")
		strLinkDescription =3D rs("LinkDescription")
		strLinkCategoryID =3D rs("LinkCategoryID")
		strLinkAddedDate =3D rs("LinkAddedDate")
		response.write("<a href=3D""" & strLinkURL & """>" &
strLinkName & "</a><br>" & vbCrLf)
		If Len(strLinkDescription) > 4 Then
response.write(strLinkDescription & "<br>" & vbCrLf)
		rs.movenext
	loop
rs.Filter =3D 0

' Add as many categories as you like

' Close Database Connection
conn.close
Set conn =3D Nothing
%>


</BODY>
</HTML>

-----Original Message-----
From: Jayne.Castellucci@L...
[mailto:Jayne.Castellucci@L...]
Sent: 20 June 2002 18:18
To: ASP Databases
Subject: [asp_databases] RE: Putting a Simple Database on the Web?


Where r u putting your db? What is your connection statement?

JC





-----Original Message-----
From: webmaster@c... [mailto:webmaster@c...]
Sent: Thursday, June 20, 2002 2:24 PM
To: ASP Databases
Subject: [asp_databases] Putting a Simple Database on the Web?


Sorry to ask this seemingly simple question but I've been trying to
place a simple database on the web.

When I do so the response is:

ADODB.Connection.1 error '800a0bb9'

The application is using arguments that are of the wrong type, are out
of acceptable range, or are in conflict with one another.

/asp/linkspage.asp, line 22

I have tried a number of sample codes from different places without
success.  And yet they all run on PWS.

My hosting company has

Apache/1.3.22 (Unix) PHP/4.0.6 FrontPage/5.0.2.2510 CHILI!ASP/DISPINT10
(3.6.0.809; Mar 28 2001) Linux/#1 SMP Wed Mar 13 12:39:13 EST
20022.2.19-6.2.16smp

Is there something that I am overlooking?  Although I am a beginner to
ASP I have used Miva Script and HTML extensively.

I would be very grateful for any advise.

Patxi

P.S. I already have Active Server Pages 3.0 (wrox) but am running out of
ideas.
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 

---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 


Message #3 by webmaster@c... on Thu, 20 Jun 2002 18:24:25
Sorry to ask this seemingly simple question but I've been trying to place 
a simple database on the web.

When I do so the response is:

ADODB.Connection.1 error '800a0bb9' 

The application is using arguments that are of the wrong type, are out of 
acceptable range, or are in conflict with one another. 

/asp/linkspage.asp, line 22 

I have tried a number of sample codes from different places without 
success.  And yet they all run on PWS.  

My hosting company has

Apache/1.3.22 (Unix) PHP/4.0.6 FrontPage/5.0.2.2510 
CHILI!ASP/DISPINT10 (3.6.0.809; Mar 28 2001)
Linux/#1 SMP Wed Mar 13 12:39:13 EST 20022.2.19-6.2.16smp 

Is there something that I am overlooking?  Although I am a beginner to ASP 
I have used Miva Script and HTML extensively.  

I would be very grateful for any advise.

Patxi

P.S. I already have Active Server Pages 3.0 (wrox) but am running out of 
ideas.
Message #4 by Jayne.Castellucci@L... on Thu, 20 Jun 2002 13:18:01 -0400
Where r u putting your db? What is your connection statement?

JC





-----Original Message-----
From: webmaster@c... [mailto:webmaster@c...] 
Sent: Thursday, June 20, 2002 2:24 PM
To: ASP Databases
Subject: [asp_databases] Putting a Simple Database on the Web?


Sorry to ask this seemingly simple question but I've been trying to place 
a simple database on the web.

When I do so the response is:

ADODB.Connection.1 error '800a0bb9' 

The application is using arguments that are of the wrong type, are out of 
acceptable range, or are in conflict with one another. 

/asp/linkspage.asp, line 22 

I have tried a number of sample codes from different places without 
success.  And yet they all run on PWS.  

My hosting company has

Apache/1.3.22 (Unix) PHP/4.0.6 FrontPage/5.0.2.2510 
CHILI!ASP/DISPINT10 (3.6.0.809; Mar 28 2001)
Linux/#1 SMP Wed Mar 13 12:39:13 EST 20022.2.19-6.2.16smp 

Is there something that I am overlooking?  Although I am a beginner to ASP 
I have used Miva Script and HTML extensively.  

I would be very grateful for any advise.

Patxi

P.S. I already have Active Server Pages 3.0 (wrox) but am running out of 
ideas.
Message #5 by "Pat Waddington" <paw@s...> on Mon, 24 Jun 2002 17:51:59 +0100
Sorry about the delay in posting a response, but I hope this will be
helpful.

The hosting services I have used to date are very particular about where you
put a database - unless I specifically request otherwise (and specify the
type of file to be held therein, and in the case of databases the type of
connection) the folder they nominate is the only one that allows full
read/write/delete permissions when accessed via ASP. This is quite
understandable if they want to maintain security and integrity. Check with
your hosting service to see if they specify where your database should be
located.

Also, one of the hosting services that I use allows both DSN and DSN-less
access to databases.

My other primary hosting services provider allows only DSN connections in a
designated folder. Again, a question of security (and also income, because
they will provide additional DSN connections at a price), since they will
delete any databases set up other than where they specify. I make a point of
advising them if I am using any other folder to hold backups of my DBs. They
do, however, allow FSO access to sub-folders, with full permissions. This
may seem a little harsh, but all it requires it a little more thought about
your DB design.

HTH

-----Original Message-----
From: Castellucci, Jayne [mailto:Jayne.Castellucci@L...]
Sent: 20 June 2002 18:29
To: ASP Databases
Subject: [asp_databases] RE: Putting a Simple Database on the Web?


I'm not 100% sure, but I think you may need to declare the actual path
in DBQ, as:

connStr = "DRIVER={Microsoft Access Driver (*.mdb)};
DBQ=C:\inetpub\wwwroot\..."

I guess the path would vary depending on where your inetpub\wwwroot
directory is.

I'm sorry, that's all I can think of. Good luck.

JC



-----Original Message-----
From: Webmaster [mailto:webmaster@c...]
Sent: Thursday, June 20, 2002 1:22 PM
To: ASP Databases
Subject: [asp_databases] RE: Putting a Simple Database on the Web?


In the same folder as the asp script!

An example is below: (it should work, so I've been told)
<html>
<head>
	<title> Links Page </title>
</head>

<body>
<font face="Verdana,Arial" size="2">

<b>Links Page</b><p>

<%

' Establish Database Connection
Set conn = Server.CreateObject("ADODB.Connection")
connStr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("links.mdb")
Conn.Open connStr
Set Session("myConn") = conn

' Open RecordSet, Sorted by Category & Alphabetically
' Database Table: Links

strSQLQuery = "SELECT * FROM Links ORDER BY LinkCategoryID, LinkName"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQLQuery, conn, 3, 3

' Display Links in Category 1
rs.Filter = "LinkCategoryID = 1"
Response.write("Category 1<p>" & vbCrLf)
	do until rs.eof
		strLinkURL = rs("LinkURL")
		strLinkName = rs("LinkName")
		strLinkDescription = rs("LinkDescription")
		strLinkCategoryID = rs("LinkCategoryID")
		strLinkAddedDate = rs("LinkAddedDate")
		response.write("<a href=""" & strLinkURL & """>" &
strLinkName & "</a><br>" & vbCrLf)
		If Len(strLinkDescription) > 4 Then
response.write(strLinkDescription & "<br>" & vbCrLf)
		rs.movenext
	loop
rs.Filter = 0

' Display Links in Category 2
rs.Filter = "LinkCategoryID = 2"
Response.write("Category 2<p>" & vbCrLf)
	do until rs.eof
		strLinkURL = rs("LinkURL")
		strLinkName = rs("LinkName")
		strLinkDescription = rs("LinkDescription")
		strLinkCategoryID = rs("LinkCategoryID")
		strLinkAddedDate = rs("LinkAddedDate")
		response.write("<a href=""" & strLinkURL & """>" &
strLinkName & "</a><br>" & vbCrLf)
		If Len(strLinkDescription) > 4 Then
response.write(strLinkDescription & "<br>" & vbCrLf)
		rs.movenext
	loop
rs.Filter = 0

' Add as many categories as you like

' Close Database Connection
conn.close
Set conn = Nothing
%>


</BODY>
</HTML>

-----Original Message-----
From: Jayne.Castellucci@L...
[mailto:Jayne.Castellucci@L...]
Sent: 20 June 2002 18:18
To: ASP Databases
Subject: [asp_databases] RE: Putting a Simple Database on the Web?


Where r u putting your db? What is your connection statement?

JC





-----Original Message-----
From: webmaster@c... [mailto:webmaster@c...]
Sent: Thursday, June 20, 2002 2:24 PM
To: ASP Databases
Subject: [asp_databases] Putting a Simple Database on the Web?


Sorry to ask this seemingly simple question but I've been trying to
place a simple database on the web.

When I do so the response is:

ADODB.Connection.1 error '800a0bb9'

The application is using arguments that are of the wrong type, are out
of acceptable range, or are in conflict with one another.

/asp/linkspage.asp, line 22

I have tried a number of sample codes from different places without
success.  And yet they all run on PWS.

My hosting company has

Apache/1.3.22 (Unix) PHP/4.0.6 FrontPage/5.0.2.2510 CHILI!ASP/DISPINT10
(3.6.0.809; Mar 28 2001) Linux/#1 SMP Wed Mar 13 12:39:13 EST
20022.2.19-6.2.16smp

Is there something that I am overlooking?  Although I am a beginner to
ASP I have used Miva Script and HTML extensively.

I would be very grateful for any advise.

Patxi

P.S. I already have Active Server Pages 3.0 (wrox) but am running out of
ideas.
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 

---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 






  Return to Index