Hello
I am having some trouble here, I created a Microsoft Access dataset (.accdb)
It is being used with some listboxes, comboboxes etc. The problem is when I publish the whole thing the datasets do not publish along with it and my program opens but there are not values. Anyone have any idea to allow the .accdb file to publish as a resource or something. Thanks

Better way to say it I know how to make the program direct to it but I need the database to publish along with the program.

I still have no idea what you're saying. And I can read between the lines.

I still have no idea what you're saying. And I can read between the lines.

Ok So let me explain, I have visual Studio 2010 I am using visual basic to create a program which calls data from a Microsoft Access file (a type of spreadsheet/datasheet .accdb files)

My program works and has no flaws in debug mode, the problem is say I wan't a friend to use it, I tried publishing the program it made a click once set-up and everything then I launch it, it gives an error saying it cant find the .accdb file. I need help making the installer calling to the access file. Or is there another type of data spreadsheet i can use?

You need to use standard locations for your database location when you publish your program: use the Application Data Folder; e.g. Application Data\Program Name\MYdata.accdb.

Look up Virtual Folder Names in MSDN. The Application Data folder is a virtual folder. So as long as you are using virtual folders, they will install in the same place on any machine. And when you make calls to access the database, make sure that you use the appropriate function to find that virtual folder.

The Application Data Folder is the folder recommended by Microsoft to store your application's data. Use the following format: Application Data\Program Name\MyDatabase.accdb

The problem is not your database engine. The problem is writing code that will be universal on a PC using the Windows Operating System. Also you're in a VB6 forum and you are using VB.NET (Visual Studio 2010).

I realize the word publish can be used to describe the installation process; but it has several different meanings in programming. Just use the word install: e.g. I'm having problems installing my program.

Thanks for all the help I understand I have to make it publish to Application Data, the problem is I don't know where I would go to get that done.

Personally, I would use the following method to save and locate your database:

  1. Find the Application Data folder
  2. Save the location of your folder in the registry.
  3. Use the saved value in the registry to locate your data.
Dim strDataLocation as String
strDataLocation = Environ("APPDATA") & "\My Program Name\MyData.mdb"

SaveSetting "My Program Name", "StartUp", strDataLocation

' Use this type of code or similar to save a public value for strDataLocation. And use that value for this variable repeatedly throughout your program to locate or save your data.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.