Ask a Question related to ASP Database, Design and Development.
-
Buffyslay_co_uk #1
nightmare day - Cannot get connect to Access DB using ASP page
having day from hell
i have db called dbproduct.mdb (its Microsoft Access) it has one table
(tbl_products)
my page is in wwwroot, called products.asp
my db is in db (up one from wwwroot - so if html link from file in
wwwroot would be ..\db\ etc - sorry if teaching to suck eggs)
i just need to connect and get the data - once i have done that i will
be able to do all the other stuff i need to do... but am having no
luck in connecting.
here is my code.... its a complete mess cos i have been trying so many
different things!!!
please some one help me!!!
httpL//www.buffyslay.co.uk
<%
Option Explicit
Dim conn
Dim RS
Set conn = Server.CreateObject("ADODB.Connection")
demoFilePath = "..\db\dbproduct.mdb"
conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
demoFilePath & ";"
set RS = conn.execute("select * from tbl_product")
%>
<table border="1">
<tr>
<td>id</td>
<td>Make</td>
<td>Model</td>
<td>Specification</td>
<td>picture1</td>
<td>picture2</td>
<td>List Price</td>
<td>Our Price</td>
<td>Lease Per Day</td>
</tr>
<%
Do While Not RS.EOF
%>
<tr>
<td><%= RS.Fields("id").Value %></td>
<td><%= RS.Fields("Make").Value %></td>
<td><%= RS.Fields("Model").Value %></td>
<td><%= RS.Fields("Specification").Value %></td>
<td><%= RS.Fields("picture1").Value %></td>
<td><%= RS.Fields("picture2").Value %></td>
<td><%= RS.Fields("List Price").Value %></td>
<td><%= RS.Fields("Our Price").Value %></td>
<td><%= RS.Fields("Lease Per Day").Value %></td>
</tr>
<%
RS.MoveNext
Loop
%>
</table>
<%
' Close our recordset and connection and dispose of the objects
RS.Close
Set RS = Nothing
conn.Close
Set conn = Nothing
%>
Buffyslay_co_uk Guest
-
connect to access DB
Hi, We have Cold Fusion server running on Solaris. I need to connect to Microsoft Access DB witch is on the different server. Is anybody could... -
How best to connect MS Access and Solaris CF 6.1?
I've got a request to connect my Solaris ColdFusionMX 6.1 server to an MS Access database. But apparently MS Access just talks ODBC and I see no... -
How to use “RDS.Connect” to connect to a MS Access database?
The example I am working from uses the following code which does not work: RDS.Connect = "Provider='sqloledb';Integrated Security='SSPI';Initial ... -
how can i connect with an access database
i need to work with an mdb file which contains a lot of data that might be change a lot of times and must stay an mdb file (so i cant make this file... -
Connect to Access db from VC#
Hi all, I'm trying to connect to an MS Access database using ADO.NET and C#, but I'm getting the dreaded "Microsoft Jet database engine cannot... -
Patrice FRITSCH #2
Re: nightmare day - Cannot get connect to Access DB using ASP page
Any error message ?
If something like 80004005 see [url]http://www.aspfaq.com/show.asp?id=2009[/url]
"Buffyslay_co_uk" <oogle@buffyslay.co.uk> a écrit dans le message de news:
[email]dea9d481.0307280556.d4daebf@posting.google.com[/email]...> having day from hell
>
> i have db called dbproduct.mdb (its Microsoft Access) it has one table
> (tbl_products)
>
> my page is in wwwroot, called products.asp
>
> my db is in db (up one from wwwroot - so if html link from file in
> wwwroot would be ..\db\ etc - sorry if teaching to suck eggs)
>
> i just need to connect and get the data - once i have done that i will
> be able to do all the other stuff i need to do... but am having no
> luck in connecting.
>
>
> here is my code.... its a complete mess cos i have been trying so many
> different things!!!
>
> please some one help me!!!
>
>
> httpL//www.buffyslay.co.uk
>
>
>
>
> <%
> Option Explicit
> Dim conn
> Dim RS
>
>
> Set conn = Server.CreateObject("ADODB.Connection")
> demoFilePath = "..\db\dbproduct.mdb"
> conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
> demoFilePath & ";"
>
> set RS = conn.execute("select * from tbl_product")
>
> %>
> <table border="1">
> <tr>
> <td>id</td>
> <td>Make</td>
> <td>Model</td>
> <td>Specification</td>
> <td>picture1</td>
> <td>picture2</td>
> <td>List Price</td>
> <td>Our Price</td>
> <td>Lease Per Day</td>
> </tr>
> <%
> Do While Not RS.EOF
> %>
> <tr>
> <td><%= RS.Fields("id").Value %></td>
> <td><%= RS.Fields("Make").Value %></td>
> <td><%= RS.Fields("Model").Value %></td>
> <td><%= RS.Fields("Specification").Value %></td>
> <td><%= RS.Fields("picture1").Value %></td>
> <td><%= RS.Fields("picture2").Value %></td>
> <td><%= RS.Fields("List Price").Value %></td>
> <td><%= RS.Fields("Our Price").Value %></td>
> <td><%= RS.Fields("Lease Per Day").Value %></td>
> </tr>
> <%
> RS.MoveNext
> Loop
> %>
> </table>
> <%
> ' Close our recordset and connection and dispose of the objects
> RS.Close
> Set RS = Nothing
> conn.Close
> Set conn = Nothing
>
>
> %>
Patrice FRITSCH Guest
-
DaWoE #3
Re: nightmare day - Cannot get connect to Access DB using ASP page
Try this
demoFilePath = Server.MapPath( "..\db\dbproduct.mdb")
"Buffyslay_co_uk" <oogle@buffyslay.co.uk> wrote in message
news:dea9d481.0307280556.d4daebf@posting.google.co m...> having day from hell
>
> i have db called dbproduct.mdb (its Microsoft Access) it has one table
> (tbl_products)
>
> my page is in wwwroot, called products.asp
>
> my db is in db (up one from wwwroot - so if html link from file in
> wwwroot would be ..\db\ etc - sorry if teaching to suck eggs)
>
> i just need to connect and get the data - once i have done that i will
> be able to do all the other stuff i need to do... but am having no
> luck in connecting.
>
>
> here is my code.... its a complete mess cos i have been trying so many
> different things!!!
>
> please some one help me!!!
>
>
> httpL//www.buffyslay.co.uk
>
>
>
>
> <%
> Option Explicit
> Dim conn
> Dim RS
>
>
> Set conn = Server.CreateObject("ADODB.Connection")
> demoFilePath = "..\db\dbproduct.mdb"
> conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
> demoFilePath & ";"
>
> set RS = conn.execute("select * from tbl_product")
>
> %>
> <table border="1">
> <tr>
> <td>id</td>
> <td>Make</td>
> <td>Model</td>
> <td>Specification</td>
> <td>picture1</td>
> <td>picture2</td>
> <td>List Price</td>
> <td>Our Price</td>
> <td>Lease Per Day</td>
> </tr>
> <%
> Do While Not RS.EOF
> %>
> <tr>
> <td><%= RS.Fields("id").Value %></td>
> <td><%= RS.Fields("Make").Value %></td>
> <td><%= RS.Fields("Model").Value %></td>
> <td><%= RS.Fields("Specification").Value %></td>
> <td><%= RS.Fields("picture1").Value %></td>
> <td><%= RS.Fields("picture2").Value %></td>
> <td><%= RS.Fields("List Price").Value %></td>
> <td><%= RS.Fields("Our Price").Value %></td>
> <td><%= RS.Fields("Lease Per Day").Value %></td>
> </tr>
> <%
> RS.MoveNext
> Loop
> %>
> </table>
> <%
> ' Close our recordset and connection and dispose of the objects
> RS.Close
> Set RS = Nothing
> conn.Close
> Set conn = Nothing
>
>
> %>
DaWoE Guest
-
Joe Resudek #4
Re: nightmare day - Cannot get connect to Access DB using ASP page
You could also try using a DSN to connect, which is often much easier when
first starting out
--
Joe Resudek
Frontier New Media
225 Crummer Lane
Reno, NV 89509
(775) 824-4040
(775) 824-4044 fax
[url]http://www.thefrontiergroup.com[/url]
"Buffyslay_co_uk" <oogle@buffyslay.co.uk> wrote in message
news:dea9d481.0307280556.d4daebf@posting.google.co m...> having day from hell
>
> i have db called dbproduct.mdb (its Microsoft Access) it has one table
> (tbl_products)
>
> my page is in wwwroot, called products.asp
>
> my db is in db (up one from wwwroot - so if html link from file in
> wwwroot would be ..\db\ etc - sorry if teaching to suck eggs)
>
> i just need to connect and get the data - once i have done that i will
> be able to do all the other stuff i need to do... but am having no
> luck in connecting.
>
>
> here is my code.... its a complete mess cos i have been trying so many
> different things!!!
>
> please some one help me!!!
>
>
> httpL//www.buffyslay.co.uk
>
>
>
>
> <%
> Option Explicit
> Dim conn
> Dim RS
>
>
> Set conn = Server.CreateObject("ADODB.Connection")
> demoFilePath = "..\db\dbproduct.mdb"
> conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
> demoFilePath & ";"
>
> set RS = conn.execute("select * from tbl_product")
>
> %>
> <table border="1">
> <tr>
> <td>id</td>
> <td>Make</td>
> <td>Model</td>
> <td>Specification</td>
> <td>picture1</td>
> <td>picture2</td>
> <td>List Price</td>
> <td>Our Price</td>
> <td>Lease Per Day</td>
> </tr>
> <%
> Do While Not RS.EOF
> %>
> <tr>
> <td><%= RS.Fields("id").Value %></td>
> <td><%= RS.Fields("Make").Value %></td>
> <td><%= RS.Fields("Model").Value %></td>
> <td><%= RS.Fields("Specification").Value %></td>
> <td><%= RS.Fields("picture1").Value %></td>
> <td><%= RS.Fields("picture2").Value %></td>
> <td><%= RS.Fields("List Price").Value %></td>
> <td><%= RS.Fields("Our Price").Value %></td>
> <td><%= RS.Fields("Lease Per Day").Value %></td>
> </tr>
> <%
> RS.MoveNext
> Loop
> %>
> </table>
> <%
> ' Close our recordset and connection and dispose of the objects
> RS.Close
> Set RS = Nothing
> conn.Close
> Set conn = Nothing
>
>
> %>
Joe Resudek Guest
-
Bullschmidt #5
Re: nightmare day - Cannot get connect to Access DB using ASP page
You can't use .. to go UP from the root because the root is as high as
you can get. But you can get the physical path of the root by putting
up a dummy page with just:
Response.Write "Server.MapPath with . : " & Server.MapPath(".") & "<br>"
And then you should be able to figure out the physical path of one up
from that pretty easily...
Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
[url]http://www.Bullschmidt.com[/url]
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Bullschmidt Guest



Reply With Quote

