MSDOTnet.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Some help on using ODBC DSN and MS access

 
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> ODBC Dotnet
Author Message
joaotsetsemoita



Joined: 08 Aug 2007
Posts: 1

PostPosted: Tue Jul 24, 2007 9:02 am    Post subject: Some help on using ODBC DSN and MS access Reply with quote

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

Archived from group: microsoft>public>dotnet>framework>odbcnet
Back to top
View user's profile Send private message
Paul Clement



Joined: 08 Aug 2007
Posts: 154

PostPosted: Wed Jul 25, 2007 12:53 pm    Post subject: Re: Some help on using ODBC DSN and MS access Reply with quote

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)

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Access with ODBC from VB 2005 Hi everyne I`m trying to run aan acces query with parameters from VB 2005. If I do it with OleDB components I have no problems, but I need to do that with ODBC, but I get this error: ERROR [42000] Microsoft Access Driver] Invalid SQL stat

Can I access other server's odbc? As I don't have 2 computers...I can't test it e.g. can I create a Text ODBC DB on Server A and access the DB from Server B? i.e. can I specify the following connection string (from ServerB)? string myConnection = Text Driver (*.txt; *.c

ODBC access to Oracle error Hello I'm using MS ODBC for Oracle DSN to access Oracle database. I have Oracle Client 9i Administrator installed. Connection works from desktop vb.NET application. The problem appears when I try to connect from .NET webService - I obtain the following er

ASP.Net ODBC Connection to local Access 2000 fails under imp When attempting to connect to an Access 2000 DB using ADO.Net from within ASP.Net running under an impersonated local user account receiving the following error. ERROR [HY000] Microsoft Access Driver] Disk or network error. ERROR [IM006]

ODBC Data Reader and Access 2.0 Memo fields I am trying to convert data from Access 2.0 to SQL Server 2000. I have ran into a few hurdles and worked through them all except 1. I cannot get the ODBC Data reader to return the value of a large amount of data in the memo field. If there is a small a
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> ODBC Dotnet All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group