Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 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 March 13th, 2008, 02:25 AM
sb123
Guest
 
Posts: n/a
Default connectivity error

hi all.
 I am a new user to asp.I am having problem in making a connection to the access file and its showing the following error:-

"Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified" at line number 19

and i have written the connection code as follows i am not able to sort out the problem
<%
Option Explicit

    Dim objConn
    Dim strConn
    Dim objRS
    Dim strSQL
    Dim intTotalColumns
    Dim intCounter

    Const adOpenStatic = 3
    Const adLockReadOnly = 1

    Set objConn = Server.CreateObject("ADODB.Connection")
    Set objRS = Server.CreateObject("ADODB.Recordset")

    strConn = "DBQ=" & Server.MapPath("product.mdb")
    strConn = "DRIVER={Microsoft Access Driver(*.mdb)};" & strConn
    objConn.Open strConn

    strSQL = "SELECT * FROM prodtable"

    objRS.open strSql, objConn, adOpenStatic, adLockReadOnly


    intTotalColumns = objRS.Fields.Count - 1
%>
 
Old March 13th, 2008, 07:36 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This is the wrong forum for this question since you are asking a classic ASP question but the answer is quite simple. Your connection string is invalid. You are missing a semicolon in this line and I have bolded where you need to add it:

strConn = "DBQ=" & Server.MapPath("product.mdb");

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Connectivity error pratibha7881 ASP.NET 1.0 and 1.1 Basics 2 January 14th, 2008 01:21 PM
database connectivity singh.mandeep82 Struts 0 December 29th, 2007 05:22 PM
Database Connectivity cnkumar74 VB Databases Basics 13 May 23rd, 2007 10:26 AM





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