2 Attachment(s)
conecct visual basec.net to microsoft access linked table
i successfully link access database with hosted Mysql database and now i can see and edit data from linked table ,
the problem when i connect vb.net application to this linked table thats only show header without any data
this my connection string :
Code:
{Provider=Microsoft.ACE.OLEDB.12.0;Data Source="C:\Users\Mostafa\Documents\Visual Studio 2012\Projects\WindowsApplication11\WindowsApplication11\test.accdb"}
Attachment 124275
*sorry for my bad langue
Re: conecct visual basec.net to microsoft access linked table
The reason there is no data has to do with the SQL query you are running. The connection string is only used to establish a connection, which must be working for you to have gotten as much as you are getting. In fact, since you have column names, you are getting back valid data, but no records. That can mean one of a couple different things:
1) The WHERE clause in the SQL statement is constructed in such a way that no records match the criteria.
2) The database has no data in it.
3) You aren't actually working with the database that you think you are working with.
That last one is not as crazy as it sounds. Lots of people have found that they ended up copying a blank database into a local folder and are connecting to that rather than the database that has the data in it. However, the first alternative is the most likely. Show us the SQL string you are using.
Re: conecct visual basec.net to microsoft access linked table
I suspect that because the table in Access is linked to a table in MySQL, that Access just has the database structure without any actual data... Why are you trying to connect to the database through the linked Access DB and not directly to the MySQL database? The only purpose to linking a table to Access is to use Access as the front end for entering in data, esp. since Access allows you to create forms for data-entry that may rely on using SQL statements when trying to do data manipulation on the back-end database. However since you will be using VB to create your forms, linking the MySQL database to Access isn't necessary and may lead to even worse complications.