Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 8th, 2003, 12:01 AM
Registered User
 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help! Access Database Connectivity

Trying to connect to Access database on server called "msgboard.mdb" and extract from a table called BBS with all files in same folder...
---
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "msgboard.mdb"
SQL="SELECT ID,Name,Posted,Subject FROM BBS WHERE NEXT=0 ORDER BY Posted DESC"
set RS=Conn.Execute(SQL)
do while NOT RS.EOF
---
Returns error Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified


 
Old October 8th, 2003, 12:54 AM
Authorized User
 
Join Date: Jul 2003
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you created an ODBC Driver? If not, go to Control panel->Administrative Tools ->Data Sources (ODBC), double -click it and choose the System DSN tab.Click Add and find Microsoft Access Driver. On the next screen, click select and choose your database. After that define an alias name in the "data source name" textbox.Make the change below in your script:

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DSN=the_alias_name"

The other way around is a DSN-less connection, in which you have to define the Driver and the physical path to the database in one big string :). More info on this link:
http://www.able-consulting.com/ADO_Conn.htm

Take a look at DNSLess Connection and OLEDB Provider For Microsoft Jet

Cheers
Kostas Lagos


 
Old October 10th, 2003, 06:02 AM
Authorized User
 
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ittorget
Default

Set Conn=Server.CreateObject("ADODB.Connection")
Conn.open "Provider=Microsoft.JET.OLEdb.4.0; data source=" & Server.MapPath("/path to your *.mdb")
sql="SELECT ID,Name,posted,Subject FROM BBS WHERE next='0' order by posted DESC"
Set RecSet=Server.Createobject("ADODB.RecordSet")
RecSet.open sql,Conn

If RecSet.EOF Then
Response.Write("There are no records in the database")
Else
Do While Not RecSet.EOF

Do something

RecSet.MoveNext
Loop



Here you have some code that might help you...........







Similar Threads
Thread Thread Starter Forum Replies Last Post
database connectivity singh.mandeep82 Struts 0 December 29th, 2007 05:22 PM
Database Connectivity asearle XSLT 4 October 16th, 2006 06:41 AM
Database Connectivity pageturner71 Access 1 September 8th, 2004 05:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.