473,394 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Can't connect To MS Access DB with ASP

Hey,

I just started working at this new company and they gave me a simple
database project to start with. yet I am starting to look like an
idiot cause I can't even seem to connect to the MS Access DB with ASP.

I already went into Data Sources (ODBC) with windows Control panel and
set up a DSN. I don't think that is the problem. I am no expert at
all at asp...

can anyone see what I am doign wrong here? The name of my Data Source
is "order" and the actual database is order.mdb

If anyone can help me out or point me in the right direct I would be
very greatful!!!

Ryan Ritten

P.S. when I try and run this script froma browser, it always says
"This page cannot be displayed"
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsGuestbook 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using DSN
connection
adoCon.Open "DSN=order"

'Create an ADO recordset object
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT * from order;"

'Open the recordset with the SQL query
rsGuestbook.Open strSQL, adoCon

'Reset server objects
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
%>
Nov 12 '05 #1
3 2053
Just opening a recordset doesn't actually do anything. You need to write the
contents of the recordset out to the screen.

Take a look at http://www.learnasp.com/learn/dbtable.asp for one approach

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Ryan Ritten" <sp*************@thesparticusarena.com> wrote in message
news:f4*************************@posting.google.co m...
Hey,

I just started working at this new company and they gave me a simple
database project to start with. yet I am starting to look like an
idiot cause I can't even seem to connect to the MS Access DB with ASP.

I already went into Data Sources (ODBC) with windows Control panel and
set up a DSN. I don't think that is the problem. I am no expert at
all at asp...

can anyone see what I am doign wrong here? The name of my Data Source
is "order" and the actual database is order.mdb

If anyone can help me out or point me in the right direct I would be
very greatful!!!

Ryan Ritten

P.S. when I try and run this script froma browser, it always says
"This page cannot be displayed"
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsGuestbook 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using DSN
connection
adoCon.Open "DSN=order"

'Create an ADO recordset object
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT * from order;"

'Open the recordset with the SQL query
rsGuestbook.Open strSQL, adoCon

'Reset server objects
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
%>

Nov 12 '05 #2
Shaweet web site!

rh

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:Rn******************@twister01.bloor.is.net.c able.rogers.com...
Just opening a recordset doesn't actually do anything. You need to write the contents of the recordset out to the screen.

Take a look at http://www.learnasp.com/learn/dbtable.asp for one approach

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Ryan Ritten" <sp*************@thesparticusarena.com> wrote in message
news:f4*************************@posting.google.co m...
Hey,

I just started working at this new company and they gave me a simple
database project to start with. yet I am starting to look like an
idiot cause I can't even seem to connect to the MS Access DB with ASP.

I already went into Data Sources (ODBC) with windows Control panel and
set up a DSN. I don't think that is the problem. I am no expert at
all at asp...

can anyone see what I am doign wrong here? The name of my Data Source
is "order" and the actual database is order.mdb

If anyone can help me out or point me in the right direct I would be
very greatful!!!

Ryan Ritten

P.S. when I try and run this script froma browser, it always says
"This page cannot be displayed"
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsGuestbook 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using DSN
connection
adoCon.Open "DSN=order"

'Create an ADO recordset object
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT * from order;"

'Open the recordset with the SQL query
rsGuestbook.Open strSQL, adoCon

'Reset server objects
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
%>


Nov 12 '05 #3
Ryan Ritten wrote:
Hey,

I just started working at this new company and they gave me a simple
database project to start with. yet I am starting to look like an
idiot cause I can't even seem to connect to the MS Access DB with ASP.

I already went into Data Sources (ODBC) with windows Control panel and
set up a DSN. I don't think that is the problem. I am no expert at
all at asp...

can anyone see what I am doign wrong here? The name of my Data Source
is "order" and the actual database is order.mdb

If anyone can help me out or point me in the right direct I would be
very greatful!!!

Ryan Ritten

P.S. when I try and run this script froma browser, it always says
"This page cannot be displayed"
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsGuestbook 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using DSN
connection
adoCon.Open "DSN=order"

'Create an ADO recordset object
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT * from order;"

'Open the recordset with the SQL query
rsGuestbook.Open strSQL, adoCon

'Reset server objects
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
%>


Ryan,

One thing to do is go to Tools --> Internet Options --> Advanced in IE,
and clear the checkbox that says "Show friendly HTTP error messages" if
it is checked. This will often give a lot more detail about what is
failing. You can rerun your page and see if you get a more descriptive
error message.

Another is to consider using a DSN-less connection. See:

http://www.aspfaq.com/show.asp?id=2126

If the code you post above worked without error, you'd still get a blank
screen, because you aren't displaying any of the data you're trying to
get. For testing purposes you can just try to print some value from the
first row.

--

Peter
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: chris | last post by:
Hi, I try to connect to Access with php with te code below. The database and table are ok. <?php include('../adodb/adodb.inc.php'); $db =& ADONewConnection('access'); $dsn =...
5
by: Kona | last post by:
Hello, Is it right to tell that DB2 Connect has the same function that Oracle Net ? If I have an ODBC application is it also right to tell that I have 2 possibilities on my client workstation to...
3
by: dmcquay | last post by:
Hi, I am setting up MySQL on a development box. I have set it up and can connect from localhost, but I cannot connect from another computer on the network. I have narrowed down the problem...
2
by: vikas.bhatia | last post by:
Is this still true? http://groups.google.com/group/comp.databases.ibm-db2/browse_thread/thread/58c6c36ce9006d50/778f98749d8e2983?lnk=st&q=DB2+Connect+product+license&rnum=6#778f98749d8e2983 would...
1
by: perjorgen | last post by:
Hi, My asp.net can't connect to any sql database when running 1.1 I can connect to databases if I make a windows application and if if I run asp.net 2.0 Other computers have no problem...
9
by: =?Utf-8?B?RnJpdHo=?= | last post by:
Hi all, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: ======= The...
8
by: fniles | last post by:
Can I change the connection time out in VB.Net 2003 and MS Access (using OLEDbConnection) ? When I use Connect Timeout = 60 in the connectionstring, I get an error "Multiple-step OLE DB operation...
1
by: Zuggy | last post by:
I'm trying to create a registration/login script using Access 2003. I'm using ADOdb to connect through ODBC. <?php // Connects to your Database include('adodb/adodb.inc.php'); # load code...
3
by: LamSoft | last post by:
I am not going to write a aspx to connect a SQL Server... but it tries to connect the SQL Server... Some of the Code.. protected void LoginButton_Click(object sender, EventArgs e) { if...
3
by: =?Utf-8?B?Ulc=?= | last post by:
Using this code: Dim oConn As SqlClient.SqlConnection oConn = New SqlClient.SqlConnection() oConn.ConnectionString = "..." 'Connection string I got via an .udl file oConn.Open() I get an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.