• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

Connect Visual C++ 2005 to MS-Access

Iam using Visual C++ 2005 and I have successfully connected  my MS-Access Database with my application from "Connect to Database" in the "TOOLS" menu.Because I am  a newbee in programming I would like to know the procedure for writing an sql query to access and modify my data in any way I want.My common sense tells me that I need a connection variable that will be equal to  the value of the sql query I want to write.Please en light me  here.If you also know the procedure for SQL Server please let me know.
0
Spyros_Savvides
Asked:
Spyros_Savvides
1 Solution
 
akeelmCommented:
From SQL Server 2005, you will need to add a linked server to your Access DB

LINKED SERVER:

EXEC sp_addlinkedserver       @server='whateveryouwanttocallthelink',
                        @srvproduct='',
                        @provider='SQLNCLI', //*this is just an example, you'll have to find out what provider Access uses*\\
                        @datasrc='whereyourmsaccessdbresides',
                        @location='',
                        @provstr='DRIVER={SQL SERVER}; //*this is just an example, you'll have to find out what driver it uses, possible ODBC?*\\
                        

You may need to add a login for this as well, I know you do with linking SQL servers, but never linked Access DB's. - Look for Exec sp_addlinkedsrvlogin

When you want to query your new linked server, you'll have to fully qualify it in the where statement, so if you called it Access, it would be something like - access.database.table
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now