Need help with VS 2005 and Access

smithsf22

New member
Local time
Today, 14:32
Joined
Mar 8, 2007
Messages
6
Hello,
I have written a program using VB .Net and access 2007. It works great on my pc, no problems at all. The problem happens when I try and install on another PC. The only way I can get it to work is if I put office 2007 on it. Is this correct? I thought visual studio could connect to access without having a copy of office. At the very least I thought you would be able to use access 2003 with it. I am probably totally wrong on this but I thought I would ask some experts. I was hoping to be able to package it all as one program and not have to setup the database connection through the data sources in the Administrative Tools.

Anyone able to offer me a bit of advice on this?

Thanks
 
VS 2005 Can definitely connect to an mdb file without Access installed and without setting up an ODBC connection. What problem are you experiencing?
 
Wow quick response. I am not sure where I messed this up but my program only seems to run o if I install access 2007 on the PC and setup the odbc connection through admin tools by choosing the following driver “Microsoft Access Driver(*.mdb, *.accdb)”. This is also how I was able to connect to to the DB within the program itself. Is that where the problem is maybe? Is there a better way to connect to the database?
The error I get is:

ERROR(IM002) Microsoft ODBC DRIVER Manager Data source name not found and no default driver specified.

Thanks again


there is large amount of data after the error i can post if it will help
 
I can't seem to find the pdf file, but I know I have a printed copy at my desk at work. I'll try to either type out the stuff from there, or scan and upload here. I'll set a reminder in my calendar. Give me about 20-24 hours as I'm not sure if I will get it up until after work tomorrow, or before.
 
To add a Data Source to the VS 2005 for an Access database, you can:

a. From the Data Menu, click on Add New Data Source

b. Choose Database and press Next

c. Select New Connection

d. Under Data source, press the Change button and select Microsoft Access Database File. Press OK

e. Under Database file name, press the browse button and select your file.

f. Press the TEST CONNECTION button. The connection test should succeed. Close that dialog and press OK.

g. From the "Choose Your Data Connection" screen, press NEXT.

h. You will now be presented with a pop up asking if you want VS to copy the file to your project. If you click NO it will leave it in it's current location, and if you click YES it will copy the file to your project location.

i. Expand the Tables tree view.

j. Check your tables that you want included.

l. Click Finish
 
To add a Data Source to the VS 2005 for an Access database, you can:
::
::l. Click Finish

Which worked normaly quit well. But since a fwe days I have the following problem.

After adding the acccess db via the way above the dataconnection and the use of the DataGridView is working as long as I am in the DevelopmentEnvironment. As soon i start the application i get the following message

exception
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

and the stack trace
bei System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
bei System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)
bei System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
bei System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
bei System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
bei System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
bei System.Data.Odbc.OdbcConnection.Open()
bei KTR_Client.clsDB.CheckDBConnection(DBEnum enumIn) in D:\***\source\KTR Client\KTR Client\clsDB.vb:Zeile 48.

Line 48
connection.Open()

Connection String
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=I:\KTRLocal.mdb;UserId=admin;Password=

Thanks in advance

VS 2005, Access 2000
 
Last edited:

Users who are viewing this thread

Back
Top Bottom