DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 24 Jul 2007 05:02:43 -0700,    posted on: microsoft.public.dotnet.framework.odbcnet        back       

Thread Index
  1    unknown
          2    Paul Clement


Some help on using ODBC DSN and MS access   
Hi everybody,

Im trying to access a Ms Access database outside my root website
folder, so Im using ODBC DSN. I have already the DSN create and
working (this same DSN is used by many classic ASP websites I have
running on my remote server). Im also have latest ODBC and JET
drivers
installed.


My code is something like this:


Dim objConn As New OdbcConnection
objConn.ConnectionString = "DSN=MyDSN;"


objConn.Open()


Const strSQL As String = "SELECT * FROM customers"
Dim objCmd As New OdbcCommand(strSQL, objConn)


However when I try to run this I always get the error "ERROR [IM002]
[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified" on the line that opens the connection ->
objConn.Open()


Any sugestion why is this happening? Or perhaps some turnaround on
how
to access a MS Access database that is outside my root webfolder.


Any help is higly appreciated


Thanks in advance


Joao
Date:Tue, 24 Jul 2007 05:02:43 -0700   Author:  

Re: Some help on using ODBC DSN and MS access   
On Tue, 24 Jul 2007 05:02:43 -0700, joaotsetsemoita@gmail.com wrote:

 Hi everybody,
 
 Im trying to access a Ms Access database outside my root website
 folder, so Im using ODBC DSN. I have already the DSN create and
 working (this same DSN is used by many classic ASP websites I have
 running on my remote server). Im also have latest ODBC and JET
 drivers
 installed.
 
 
 My code is something like this:
 
 
 Dim objConn As New OdbcConnection
 objConn.ConnectionString = "DSN=MyDSN;"
 
 
 objConn.Open()
 
 
 Const strSQL As String = "SELECT * FROM customers"
 Dim objCmd As New OdbcCommand(strSQL, objConn)
 
 
 However when I try to run this I always get the error "ERROR [IM002]
 [Microsoft][ODBC Driver Manager] Data source name not found and no
 default driver specified" on the line that opens the connection ->
 objConn.Open()
 
 
 Any sugestion why is this happening? Or perhaps some turnaround on
 how
 to access a MS Access database that is outside my root webfolder.


What happens if you use a DSN-less connection (with Jet OLEDB) instead of a DSN (and ODBC)? Jet
OLEDB is the preferred method as it provides better feature support and is the more stable
technology.


Paul
~~~~
Microsoft MVP (Visual Basic)
Date:Wed, 25 Jul 2007 08:53:06 -0500   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us