|
 |
asp_databases thread: database connection & retrieving data access database
Message #1 by "spencer" <solopress_@h...> on Mon, 23 Oct 2000 09:08:37 +0100
|
|
this is my code the database resides on fasthosts
e:/mycompany/website/Databases/car.mdb
the error i get is datasource name to long
<%@ Language=VBScript %>
<% Option Explicit %>
<!- -#include virtual="common/adovbs.inc" - ->
<HTML>
<BODY>
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=car.dsn"
Dim objRS
set objRS = server.CreateObject ("ADODB.recordset")
objRS.open "peugeot206", ,adCmdTable
%>
<TABLE border=1>
<TR>
<TD><B>Description</B></TD>
<TD><B>UK price</B></TD>
<TD><B>Our price</B></TD>
</TR>
<%
Do While Not objRS.EOF
Response.write "<TR><TD>" & objRS("Description") & "</TD>"
Response.write "<TR><TD>" & objRS("Uk_price") & "</TD>"
Response.write "<TR><TD>" & objRS("Our_price") & "</TD></TR>"
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
</TABLE>
</BODY>
</HTML>
Message #2 by "Neale, Chris" <chris.neale@t...> on Mon, 23 Oct 2000 11:37:01 +0100
|
|
Any reason why you're not opening your database connection? An 'open' would
really help. ( objConn.open )
Chris
-----Original Message-----
From: spencer [mailto:solopress_@h...]
Sent: 23 October 2000 09:09
To: ASP Databases
Subject: [asp_databases] database connection & retrieving data access
database
this is my code the database resides on fasthosts
e:/mycompany/website/Databases/car.mdb
the error i get is datasource name to long
<%@ Language=VBScript %>
<% Option Explicit %>
<!- -#include virtual="common/adovbs.inc" - ->
<HTML>
<BODY>
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=car.dsn"
Dim objRS
set objRS = server.CreateObject ("ADODB.recordset")
objRS.open "peugeot206", ,adCmdTable
%>
<TABLE border=1>
<TR>
<TD><B>Description</B></TD>
<TD><B>UK price</B></TD>
<TD><B>Our price</B></TD>
</TR>
<%
Do While Not objRS.EOF
Response.write "<TR><TD>" & objRS("Description") & "</TD>"
Response.write "<TR><TD>" & objRS("Uk_price") & "</TD>"
Response.write "<TR><TD>" & objRS("Our_price") & "</TD></TR>"
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
</TABLE>
</BODY>
</HTML>
__________________________________________________________________________
TNL (TM) - The Next Level Systems Ltd
http://www.tnl.co.uk
theexportsite Ltd
http://www.theexportsite.com
|
|
 |